The following code: template<typename T, typename U> struct tuple { tuple(T, U) { } }; struct Y { tuple<int, int> tt = tuple<int, int>{1, 2}; // *error* }; Fails with a parse error in gcc 4.7 20111210: $ g++-snapshot -c -std=c++11 nsdmi3.cc nsdmi3.cc:9:36: error: expected unqualified-id before 'int' nsdmi3.cc:9:31: error: wrong number of template arguments (1, should be 2) nsdmi3.cc:2:9: error: provided for 'template<class T, class U> struct tuple' $ g++-snapshot --version g++ (Debian 20111210-1) 4.7.0 20111210 (experimental) [trunk revision 182188] Thanks, -miles
I bet a beer this is related to PR 57 (one of the most duplicated bugs in bugzilla). In fact the same work around fixes this testcase. Jason can you comment if DR 325 applies to NSDMI and not just default arguments?
Ah yes, the latest note on DR 325 confirms the same issue exists with NSDMIs http://open-std.org/JTC1/SC22/WG21/docs/cwg_active.html#325
Author: jason Date: Mon Jan 2 17:53:16 2012 New Revision: 182809 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182809 Log: DR 325 PR c++/51666 * parser.c (cp_parser_cache_defarg): Split out... (cp_parser_parameter_declaration): ...from here. (cp_parser_save_nsdmi): Use it. (cp_parser_cache_group): Remove CPP_COMMA support. Added: trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer5.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog
I suppose this can be closed as fixed.