[Bug c++/50431] New: lambda bug for array size def
zhudiqi at 163 dot com
gcc-bugzilla@gcc.gnu.org
Fri Sep 16 11:41:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50431
Bug #: 50431
Summary: lambda bug for array size def
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: zhudiqi@163.com
This code is OK,
OK:
constexpr auto sz = []()->long { return 100L; };
int arr1[sz()];
int arr2[[]()->long { return 100L; }()];
But these code will failed for g++ compiler 4.6.1.
BUG1:
auto sz = []()->constexpr long { return 100L; };
int arr[[]()->long { return 100L; }];
BUG2:
//feature.cpp:51:38: internal compiler error: Segmentation fault
int arr[[]()->long { return 100L; }];
More information about the Gcc-bugs
mailing list