This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR c++/20499: ICE on duplicate class definition
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 20 Mar 2005 17:55:21 -0800
- Subject: Re: [patch] Fix PR c++/20499: ICE on duplicate class definition
- Organization: CodeSourcery, LLC
- References: <200503161725.j2GHPcGJ000261@relay.rwth-aachen.de>
Volker Reichelt wrote:
The IMHO right fix is to return a NULL_TREE instead (conforming to the
comment) which is implemented in the following patch. The additional
jump is required to bypass xref_basetypes which crashes with a NULL_TREE
as first argument.
Agreed.
The patch also modifies g++.dg/parse/error16.C so that it cannot fall
through the cracks again (until a better solution for the testsuite is
implemented).
Bootstrapped and regtested.
Ok for 4.0 branch and mainline?
Yes.
A question remains, though: What about the other code paths where c_p_c_h
returns an error_mark_node? Will they cause ICEs, too? Or are they safe
(or just never taken)?
Note that this function is permitted by its documentation to return
error_mark_node -- just not for this case. So, callers should be able
to deal with that. I'm not sure what the situation in practice is, though.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304