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]

[patch] PR c++/25369: backport to 3.4 branch


The following patch is a straightforward backport of Mark's patch
http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01494.html
for PR c++/24278 (ICE printing an error message) to the 3.4 branch.

Bootstrapped and regtested on x86_64-unknown-linux-gnu.
Ok for the 3.4 branch?

Regards,
Volker


:ADDPATCH C++:


2006-01-31  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>

	Backport:
	2005-12-19  Mark Mitchell  <mark@codesourcery.com>

	PR c++/24278
	* init.c (expand_member_init): Print messages about baseclasses
	using %T rather than %D.

===================================================================
--- gcc/gcc/cp/init.c	(revision 110426)
+++ gcc/gcc/cpinit.c	(working copy)
@@ -1015,11 +1015,11 @@
       if (!direct_binfo && !virtual_binfo)
 	{
 	  if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
-	    error ("type `%D' is not a direct or virtual base of `%T'",
-		   name, current_class_type);
+	    error ("type `%T' is not a direct or virtual base of `%T'",
+		   basetype, current_class_type);
 	  else
-	    error ("type `%D' is not a direct base of `%T'",
-		   name, current_class_type);
+	    error ("type `%T' is not a direct base of `%T'",
+		   basetype, current_class_type);
 	  return NULL_TREE;
 	}
 
===================================================================

2006-01-31  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>

	Backport:
	2005-12-19  Mark Mitchell  <mark@codesourcery.com>

	PR c++/24278
	* g++.dg/template/ctor5.C: New test.

===================================================================
--- gcc/gcc/testsuite/g++.dg/ext/ctor5.C	2005-08-29 00:25:44 +0200
+++ gcc/gcc/testsuite/g++.dg/ext/ctor5.C	2006-01-31 15:27:33 +0100
@@ -0,0 +1,8 @@
+// PR c++/24278
+
+template<typename T> struct A
+{
+  A() : T(0) {} // { dg-error "base" }
+};
+
+A<int*> a; // { dg-error "instantiated" }
===================================================================



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