The following C++ code void f() { int **p = new(int(*[2])); } gets what seems to be a bogus diagnostic from 4.5 and 4.6: t.C: In function 'void f()': t.C:4:21: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default] As far as I know this is valid C++98/C++03 code, not involving a lambda. 4.4 accepts it with no diagnostic.
Confirmed. Looks like there might be some ambiguous in the parsing with lambda's.
GCC 4.5.2 is being released, adjusting target milestone.
*** Bug 47651 has been marked as a duplicate of this bug. ***
Author: jason Date: Wed Mar 2 18:18:41 2011 New Revision: 170621 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170621 Log: PR c++/46159 * parser.c (cp_parser_primary_expression): Don't warn about a failed tentative parse. Added: trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-98.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog
Fixed on the trunk so far.
Author: jason Date: Wed Mar 2 18:46:01 2011 New Revision: 170622 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170622 Log: PR c++/46159 * parser.c (cp_parser_primary_expression): Don't warn about a failed tentative parse. Added: branches/gcc-4_5-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-98.C Modified: branches/gcc-4_5-branch/gcc/cp/ChangeLog branches/gcc-4_5-branch/gcc/cp/parser.c branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
Fixed in 4.5 as well.