This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix PR c++/20499: ICE on duplicate class definition


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]