Bug 48212 - [4.6/4.7 Regression] [C++0x] ICE: in non_const_var_error, at cp/semantics.c:6700 on invalid code
[4.6/4.7 Regression] [C++0x] ICE: in non_const_var_error, at cp/semantics.c:6...
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: c++
4.7.0
: P4 normal
: 4.6.1
Assigned To: Jason Merrill
: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-20 16:46 UTC by Zdenek Sojka
Modified: 2011-03-31 20:34 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.5.3
Known to fail: 4.6.0, 4.7.0
Last reconfirmed: 2011-03-20 18:36:56


Attachments
reduced testcase (69 bytes, text/plain)
2011-03-20 16:46 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2011-03-20 16:46:21 UTC
Created attachment 23730 [details]
reduced testcase

$ gcc -std=gnu++0x testcase.C 
testcase.C: In function 'void foo()':
testcase.C:4:17: error: expected primary-expression before ';' token
testcase.C:5:9: error: the value of 'b' is not usable in a constant expression
testcase.C:5:9: internal compiler error: in non_const_var_error, at cp/semantics.c:6700
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Tested revisions:
r171193 - crash
4.6 r170955 - crash
4.5 r170955 - crash
Comment 1 Jakub Jelinek 2011-03-25 19:52:00 UTC
GCC 4.6.0 is being released, adjusting target milestone.
Comment 2 Jason Merrill 2011-03-30 20:29:23 UTC
Author: jason
Date: Wed Mar 30 20:29:13 2011
New Revision: 171748

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171748
Log:
	PR c++/48212
	* semantics.c (non_const_var_error): Just return if DECL_INITIAL
	is error_mark_node.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Jason Merrill 2011-03-30 20:29:49 UTC
Author: jason
Date: Wed Mar 30 20:29:43 2011
New Revision: 171749

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171749
Log:
	PR c++/48212
	* semantics.c (non_const_var_error): Just return if DECL_INITIAL
	is error_mark_node.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/semantics.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 4 Jason Merrill 2011-03-31 20:34:52 UTC
Fixed.