From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.4.2) Gecko/20040301 Description of problem: When compiling the test case, the compiler crashes with an internal error/segmentation fault. Version-Release number of selected component (if applicable): gcc-c++-3.2.3-34 How reproducible: Always Steps to Reproduce: 1. c++ -c an.cc Additional info:
Created attachment 100323 [details] Test case triggering the crash.
This is crash on invalid input, so lowering priority.
> This is crash on invalid input True. In the original case it was quite hard to see what was invalid though! :-)
Self-contained testcase: struct A { void foo (); }; struct B { enum E { EE }; struct C { A c; void foo () { c.foo(); }; }; E bar (); } B::E B::bar () {} This is really fixed for good just with the new parser in GCC 3.4+. Particular problem is lastiddecl handling and that in case of syntax errors it gets out of sync from the actual identifier node. A quick hack like: --- gcc/cp/semantics.c 2005-01-04 10:25:30.000000000 +0100 +++ gcc/cp/semantics.c 2005-01-04 14:06:56.385999603 +0100 @@ -1965,6 +1965,8 @@ enter_scope_of (sr) { tree scope = TREE_OPERAND (sr, 0); + if (scope == NULL || scope == error_mark_node) + return; if (TREE_CODE (scope) == NAMESPACE_DECL) { push_decl_namespace (scope); gets rid of the ICE, but is IMHO not suitable for RHEL3.