Bug 37389 - [4.2/4.3 Regression] expected integer_cst, have error_mark in build_enumerator
Summary: [4.2/4.3 Regression] expected integer_cst, have error_mark in build_enumerator
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P3 minor
Target Milestone: 4.3.3
Assignee: Jakub Jelinek
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2008-09-05 22:28 UTC by Matthias Klose
Modified: 2009-04-29 15:16 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.1.1 4.4.0
Known to fail: 4.2.4 4.3.2
Last reconfirmed: 2008-09-09 07:58:52


Attachments
preprocessed source (126.79 KB, application/x-gzip)
2008-09-05 22:29 UTC, Matthias Klose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2008-09-05 22:28:32 UTC
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.
Comment 1 Matthias Klose 2008-09-05 22:29:05 UTC
Created attachment 16237 [details]
preprocessed source
Comment 2 Andrew Pinski 2008-09-05 22:37:42 UTC
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,
Comment 3 Jakub Jelinek 2008-09-09 07:58:52 UTC
Mine.
Comment 4 Jakub Jelinek 2008-09-09 19:18:11 UTC
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

Comment 5 Jakub Jelinek 2008-09-09 20:24:30 UTC
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

Comment 6 Jakub Jelinek 2008-09-09 20:25:32 UTC
Fixed.