For the following code: struct S { int a; float b; }; struct T { T(S s) {} }; int main() { T t(S{1, 0.1}); // ERROR HERE } gcc 4.6 trunk gives the following errors (with the --std=c++0x option): decl.cpp: In function 'int main()': decl.cpp:14:10: error: expected ')' before '{' token decl.cpp:14:10: error: a function-definition is not allowed here before '{' token decl.cpp:14:18: error: expected primary-expression before ')' token decl.cpp:14:18: error: expected ';' before ')' token It seems gcc is interpreting the statement as a function declaration. I think this is valid C++0x.
Author: jason Date: Wed May 25 19:50:49 2011 New Revision: 174225 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174225 Log: PR c++/47184 * parser.c (cp_parser_parameter_declaration): Recognize list-initialization. (cp_parser_direct_declarator): Check for the closing paren before parsing definitely. Added: trunk/gcc/testsuite/g++.dg/cpp0x/initlist51.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog
Author: jason Date: Wed May 25 20:29:39 2011 New Revision: 174232 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174232 Log: PR c++/47184 * parser.c (cp_parser_parameter_declaration): Recognize list-initialization. (cp_parser_direct_declarator): Check for the closing paren before parsing definitely. Added: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/initlist51.C Modified: branches/gcc-4_6-branch/gcc/cp/ChangeLog branches/gcc-4_6-branch/gcc/cp/parser.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Fixed for 4.6.1.
...and actually change status.