]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/24278 (ICE while trying to print out error)
authorMark Mitchell <mark@codesourcery.com>
Tue, 20 Dec 2005 04:59:42 +0000 (04:59 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Tue, 20 Dec 2005 04:59:42 +0000 (04:59 +0000)
PR c++/24278
* init.c (expand_member_init): Print messages about baseclasses
using %T rather than %D.
PR c++/24278
* g++.dg/template/ctor5.C: New test.

From-SVN: r108840

gcc/cp/ChangeLog
gcc/cp/init.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/ctor5.C [new file with mode: 0644]

index 3c79990b6ce13d7607c28c3de5f78714f4134e9d..2b3c175b9abb78fa4a36422806a3dc73792106d0 100644 (file)
@@ -1,5 +1,9 @@
 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.
+
        PR c++/24915
        * class.c (add_method): Do not treat templates as identical unless
        their return types are the same.
index f43846719e5873a89106a40e57213f137d2f6b80..f19842dddc1e1add5745bcf6ab6cf04ee37ca287 100644 (file)
@@ -1019,11 +1019,11 @@ expand_member_init (tree name)
       if (!direct_binfo && !virtual_binfo)
        {
          if (CLASSTYPE_VBASECLASSES (current_class_type))
-           error ("type %qD is not a direct or virtual base of %qT",
-                  name, current_class_type);
+           error ("type %qT is not a direct or virtual base of %qT",
+                  basetype, current_class_type);
          else
-           error ("type %qD is not a direct base of %qT",
-                  name, current_class_type);
+           error ("type %qT is not a direct base of %qT",
+                  basetype, current_class_type);
          return NULL_TREE;
        }
 
index e87eb1d688a2b46b49f1106b38f6dd8036d82ba7..fe6953e5ef1e504ff488922b302abba501ae05cd 100644 (file)
@@ -1,5 +1,8 @@
 2005-12-19  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/24278
+       * g++.dg/template/ctor5.C: New test.
+
        PR c++/24915
        * g++.dg/template/overload8.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/template/ctor5.C b/gcc/testsuite/g++.dg/template/ctor5.C
new file mode 100644 (file)
index 0000000..18e55d1
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/24278
+
+template<typename T> struct A
+{
+  A() : T(0) {} // { dg-error "base" }
+};
+
+A<int*> a; // { dg-error "instantiated" }