The following invalid code snippet triggers an ICE since GCC 3.4.0: =============================== template<int N> struct A { enum { M = && N }; }; A<0> a; =============================== bug.cc:3: error: label 'N' referenced outside of any function bug.cc: In instantiation of 'A<0>': bug.cc:6: instantiated from here bug.cc:3: internal compiler error: in perform_integral_promotions, at cp/typeck.c:1613 Please submit a full bug report, [etc.]
enum { M = && N }; alone is enough to trigger this.
Subject: Bug 33836 Author: jakub Date: Mon Nov 5 08:18:03 2007 New Revision: 129896 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129896 Log: PR c++/33836 * parser.c (cp_parser_unary_expression): For &&label call cp_parser_non_integral_constant_expression and return error_mark_node if it returned true. * g++.dg/ext/label10.C: New test. Added: trunk/gcc/testsuite/g++.dg/ext/label10.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog
Fixed on the trunk so far.
Closing 4.1 branch.
Closing 4.2 branch, fixed in 4.3.