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] |
The following invalid testcase currently triggers a seg fault in decay_conversion:
struct A { virtual ~A() {} };
struct B : A, virtual A {}; struct C : A, B {};
The proposed fix for this to adjust the return type of xref_basetypes to bool so that the parser can detect if processing the base classes failed in cp_parser_class_head (in which case xref_basetypes will return false), if it has then the type is set to NULL_TREE which, according to the comment at the top of the function, will cause the type to be discarded, preventing the ICE later on.
Cheers, Lee.
PR c++/27952 * cp-tree.h (xref_basetypes): Adjust to return bool instead of void. * decl.c (xref_basetypes): Likewise. Return false if the class bases are invalid. * parser.c (cp_parser_class_head): Check the return value from xref_basetypes, discard the type is the base classes are invalid.
PR c++/27952 * g++.dg/inherit/virtual1.C: New test.
Attachment:
pr27952.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |