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: PR 11991


This patch fixes an ICE on the 3.3 branch.  This is already fixed on
the mainline, in a much superior way, but this gets the job done.

Tested on i686-pc-linux-gnu, applied on the branch.  The test goes on
the mainline too.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2003-09-17  Mark Mitchell  <mark@codesourcery.com>

	PR c++/11991
	* typeck2.c (incomplete_type_diagnostic): Robustify.

2003-09-17  Mark Mitchell  <mark@codesourcery.com>

	PR c++/11991
	* g++.dg/rtti/typeid3.C: New test.

Index: cp/typeck2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck2.c,v
retrieving revision 1.132.4.3
diff -c -5 -p -r1.132.4.3 typeck2.c
*** cp/typeck2.c	3 Mar 2003 21:58:25 -0000	1.132.4.3
--- cp/typeck2.c	17 Sep 2003 23:43:40 -0000
*************** retry:
*** 277,287 ****
        else
          (*p_msg) ("insufficient contextual information to determine type");
        break;
      
      default:
!       abort ();
      }
  }
  
  /* Backward-compatibility interface to incomplete_type_diagnostic;
     required by ../tree.c.  */
--- 277,288 ----
        else
          (*p_msg) ("insufficient contextual information to determine type");
        break;
      
      default:
!       (*p_msg) ("invalid use of incomplete type");
!       break;
      }
  }
  
  /* Backward-compatibility interface to incomplete_type_diagnostic;
     required by ../tree.c.  */
Index: testsuite/g++.dg/rtti/typeid3.C
===================================================================
RCS file: testsuite/g++.dg/rtti/typeid3.C
diff -N testsuite/g++.dg/rtti/typeid3.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/rtti/typeid3.C	17 Sep 2003 23:43:41 -0000
***************
*** 0 ****
--- 1,11 ----
+ #include <typeinfo> 
+  
+ template <template <class> class T> struct A { 
+     void error() { 
+       typeid(T).name(); // { dg-error "" }
+     } 
+ }; 
+  
+ template <class T> struct B {}; 
+  
+ template void A<B>::error(); // { dg-error "instantiated" }


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