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]

[C++ PATCH,committed] Fix PR10793 (Error recovery in xref_basetypes)


Hi

This simple patch fixes an ICE in xref_basetypes due to
errorneous class declaration, reported a few times in the
bugzilla (PR10793, 11132).  Tested on i686-pc-linux-gnu.
Committed to mainline as obvious

--Kriang


2003-07-22  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

	PR c++/10793
	* decl.c (xref_basetypes): Handle error_mark_node.

2003-07-22  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

	PR c++/10793
	* g++.dg/template/crash9.C: New test.

diff -cprN gcc-main-save/gcc/cp/decl.c gcc-main-new/gcc/cp/decl.c
*** gcc-main-save/gcc/cp/decl.c	Tue Jul 22 19:39:08 2003
--- gcc-main-new/gcc/cp/decl.c	Tue Jul 22 19:32:12 2003
*************** xref_basetypes (tree ref, tree base_list
*** 12831,12836 ****
--- 12831,12839 ----
    int i;
    enum tag_types tag_code;
  
+   if (ref == error_mark_node)
+     return;
+ 
    if (TREE_CODE (ref) == UNION_TYPE)
      {
        error ("derived union `%T' invalid", ref);
diff -cprN gcc-main-save/gcc/testsuite/g++.dg/parse/crash9.C gcc-main-new/gcc/testsuite/g++.dg/parse/crash9.C
*** gcc-main-save/gcc/testsuite/g++.dg/parse/crash9.C	Thu Jan  1 07:00:00 1970
--- gcc-main-new/gcc/testsuite/g++.dg/parse/crash9.C	Tue Jul 22 20:07:03 2003
***************
*** 0 ****
--- 1,9 ----
+ // { dg-do compile }
+ 
+ // Origin: Volker Reichelt <reichelt@gcc.gnu.org>
+ 
+ // PR c++/10793: ICE in handling base class when the current class
+ // contains error.
+ 
+ template <typename> struct A {};
+ template <typename> struct A<INVALID> : A<int> { }; // { dg-error "not declared|invalid" }


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