On 2015-06-18 22:11, Louis Dionne wrote:
Tested error message:
https://gist.github.com/krzysztof-jusiak/bfc51747d083e140772d
<aside> Ahaha! Finally I get this example I was looking for! To all of those that say "lambdas can't appear in unevaluated contexts because of implementation difficulties", I now dare say "Bullshit"! If you look at the above example, you'll notice that a lambda happily appears inside a `decltype(...)`. This is a Clang glitch (the only one I never reported) that only works in some specific circumstances, which allows us to have lambdas appear inside unevaluated contexts. This allows us to write type-level computations with value syntax inline, without ever needing to create an external variable.
I want lambdas in unevaluated contexts for C++17. Please. Also, people, please don't report this bug :-). </aside>
See this remark by Richard Smith: https://groups.google.com/a/isocpp.org/forum/#!msg/std-proposals/hAnVRTlsQZY... (plus some of the quoted text) According to him, the rule is dedundant by now, but removal of the rule is not on the core issues list yet. Thus, you might want add some input to the core issues :-)