http://llvm.org/bugs/show_bug.cgi?id=13484
Bug #: 13484
Summary: Non-capturing lambas should be a constant expression
Product: clang
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++11
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Although the standard doesn't specify if lambda expressions are literal types,
gcc does allow it, and this could be useful for when you want to have a lambda
at class scope.
Here is an example code:
struct A
{
static constexpr auto F = [](){};
};
int main()
{
A::F();
return 0;
}
Clang produces this error:
error: constexpr variable 'F' must be initialized by a constant
expression
static constexpr auto F = [](){};
^~~~~~
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs