seen with 4.2.4, 4.3.2 and trunk 20080904 g++ -c -mtune=generic -g foo.ii In file included from utNativePackedCoDec.cc:5: ../../src/pers/RecBuf.hh: At global scope: ../../src/pers/RecBuf.hh: In instantiation of 'pers::RecBuf<pers::NativePackedCoDec, long unsigned int>': utNativePackedCoDec.cc:11: instantiated from here ../../src/pers/RecBuf.hh:76: error: 'typename pers::NativePackedCoDec::Type' names 'template<class T> struct pers::NativePackedCoDec::Type', which is not a type ../../src/pers/RecBuf.hh:76: error: overflow in enumeration values at 'STRING_SZ' ../../src/pers/RecBuf.hh:76: error: 'typename pers::NativePackedCoDec::Type' names 'template<class T> struct pers::NativePackedCoDec::Type', which is not a type ../../src/pers/RecBuf.hh:76: internal compiler error: tree check: expected integer_cst, have error_mark in build_enumerator, at cp/decl.c:11144 Please submit a full bug report, with preprocessed source if appropriate.
Created attachment 16237 [details] preprocessed source
Confirmed reduced testcase: enum { OFFSET_MAX = (9223372036854775807L * 2UL + 1UL) }; enum { OFFSET_MAX = OFFSET_MAX, STRING_SZ = CoDec::Type::FIXED_SIZE, STRING_DYN = CoDec::Type::DYN_PARTS,
Mine.
Subject: Bug 37389 Author: jakub Date: Tue Sep 9 19:16:49 2008 New Revision: 140165 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140165 Log: PR c++/37389 * decl.c (build_enumerator): Handle previous value's DECL_INITIAL being error_operand_p. Don't clear value if it was error_mark_node. * g++.dg/parse/enum4.C: New test. Added: trunk/gcc/testsuite/g++.dg/parse/enum4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 37389 Author: jakub Date: Tue Sep 9 20:23:08 2008 New Revision: 140171 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140171 Log: PR c++/37389 * decl.c (build_enumerator): Handle previous value's DECL_INITIAL being error_operand_p. * g++.dg/parse/enum4.C: New test. Added: branches/gcc-4_3-branch/gcc/testsuite/g++.dg/parse/enum4.C Modified: branches/gcc-4_3-branch/gcc/cp/ChangeLog branches/gcc-4_3-branch/gcc/cp/decl.c branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
Fixed.