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]

C++ PATCH for crash on simple exception case



Here's a patch for yet-another-use-same_type_p-everywhere bug.
Installed on mainline and branch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

Index: testsuite/g++.old-deja/g++.eh/catch2.C
===================================================================
RCS file: catch2.C
diff -N catch2.C
--- /dev/null	Sat Dec  5 20:30:03 1998
+++ catch2.C	Wed Jun 16 17:18:40 1999
@@ -0,0 +1,11 @@
+// Build don't link:
+// Origin: Mike Danylchuk <miked@mpath.com>
+
+typedef char TCHAR;
+
+int main()
+{
+  try {}
+  catch( TCHAR* Err ) {}
+}
+
Index: testsuite/cp/decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.220
diff -u -p -r1.220 decl2.c
--- decl2.c	1999/05/24 23:38:55	1.220
+++ decl2.c	1999/06/17 00:18:56
@@ -2807,7 +2807,7 @@ import_export_decl (decl)
 	     since it will not be emitted when the vtable for the type
 	     is output (which is when the unqualified version is
 	     generated).  */
-	  && ctype == TYPE_MAIN_VARIANT (ctype))
+	  && same_type_p (ctype, TYPE_MAIN_VARIANT (ctype)))
 	{
 	  DECL_NOT_REALLY_EXTERN (decl)
 	    = ! (CLASSTYPE_INTERFACE_ONLY (ctype)
@@ -2818,7 +2818,8 @@ import_export_decl (decl)
 	  if (flag_weak)
 	    comdat_linkage (decl);
 	}
-      else if (TYPE_BUILT_IN (ctype) && ctype == TYPE_MAIN_VARIANT (ctype))
+      else if (TYPE_BUILT_IN (ctype) 
+	       && same_type_p (ctype, TYPE_MAIN_VARIANT (ctype)))
 	DECL_NOT_REALLY_EXTERN (decl) = 0;
       else
 	comdat_linkage (decl);


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