[cfe-dev] c++ question: can lambda be used in VLA?
James Dennett via cfe-dev
cfe-dev at lists.llvm.org
Tue May 24 19:11:36 PDT 2016
On Tue, May 24, 2016 at 6:25 PM, Akira Hatanaka via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> I wasn't requesting that clang accept lambda expressions used for array
> bounds but was asking whether it was valid in c++. Is this something that
> is open to interpretation because it's not covered by the standard?
>
> FYI, this isn't something that I made up. It was in a code a user wrote.
>
>
It's covered by the standard, and as Clang's error message says, lambdas
are not allowed in constant expressions in C++11 or C++14.
https://isocpp.org/files/papers/N4487.pdf proposed constexpr lambdas for a
future standard, and was accepted by EWG; draft wording is in
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0170r1.pdf
-- James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160524/227e9b3a/attachment.html>
More information about the cfe-dev
mailing list