gcc accepts static data member declaration with brace-or-equal-initializer for non-const literal type, when the type-specifier is the plain auto specifier. struct X { static auto member = 0 ; } ; The type of X::member is deduced to be int. But static data member declaration is allowed to have brace-or-equal-initializer if the type is const literal type. So this code must be ill-formed.
confirmed, not a regression
Author: jason Date: Fri May 27 04:01:46 2011 New Revision: 174317 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174317 Log: PR c++/47956 * decl.c (check_static_variable_definition): Now static. (cp_finish_decl): Call it here. (grokdeclarator): Not here. * pt.c (instantiate_class_template_1): Or here. * cp-tree.h: Don't declare it. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl.c trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/cpp0x/auto7.C trunk/gcc/testsuite/g++.dg/template/crash50.C trunk/gcc/testsuite/g++.dg/template/static9.C trunk/gcc/testsuite/g++.old-deja/g++.ext/memconst.C
Fixed for 4.7.0.