http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50431
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-16 13:47:49 UTC --- (In reply to comment #2) > BUG1: > auto sz = []()->constexpr long { return 100L; }; > int arr[sz()]; > > Why constexpr for lambda won't be compiled? Can i not use auto type for a > lambda variant? The closure type's function call operator can be const but not constexpr. You can use auto for a lambda, you just can't have a constexpr lambda. Why do you want it to work? What advantage is there to using a lambda instead of named function? e.g. constexpr long sz() { return 100L; }; int arr[sz()];