template<class> struct K { enum { A = sizeof"A" , B = +A }; }; ice.cc:4:32: internal compiler error: unexpected expression ‘sizeof ("A")’ of kind sizeof_expr Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. works with 4.4 & 4.5, or without -std=c++0x
the ICE goes away if K is not a template or if B is initialized with simply A, rather than an expression involving A
It is caused by revision 166167: http://gcc.gnu.org/ml/gcc-cvs/2010-11/msg00053.html
Got it.
Author: jason Date: Mon Feb 14 21:52:24 2011 New Revision: 170156 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170156 Log: PR c++/47482 * parser.c (cp_parser_enumerator_definition): Call fold_non_dependent_expr. Added: trunk/gcc/testsuite/g++.dg/cpp0x/regress/enum1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog
Fixed.