From: Mark Mitchell Date: Tue, 20 Dec 2005 04:59:42 +0000 (+0000) Subject: re PR c++/24278 (ICE while trying to print out error) X-Git-Tag: releases/gcc-4.2.0~5218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3115fd2d9b8c820af8900b35e3aec3857a3c888;p=thirdparty%2Fgcc.git re PR c++/24278 (ICE while trying to print out error) 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3c79990b6ce1..2b3c175b9abb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2005-12-19 Mark Mitchell + 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. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index f43846719e58..f19842dddc1e 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e87eb1d688a2..fe6953e5ef1e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2005-12-19 Mark Mitchell + 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 index 000000000000..18e55d179faf --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ctor5.C @@ -0,0 +1,8 @@ +// PR c++/24278 + +template struct A +{ + A() : T(0) {} // { dg-error "base" } +}; + +A a; // { dg-error "instantiated" }