From: Paolo Carlini Date: Mon, 20 May 2013 09:44:20 +0000 (+0000) Subject: re PR c++/57327 ('derived' is an ambiguous base class of 'base' diagnostic is backwards) X-Git-Tag: releases/gcc-4.9.0~5804 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a293ed6ec64c9a5364c72fc96e08e345d0104822;p=thirdparty%2Fgcc.git re PR c++/57327 ('derived' is an ambiguous base class of 'base' diagnostic is backwards) /cp 2013-05-20 Paolo Carlini PR c++/57327 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform. /testsuite 2013-05-20 Paolo Carlini PR c++/57327 * g++.dg/template/error50.C: New. From-SVN: r199097 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dd53e69d9382..9d8ad5080ebb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2013-05-20 Paolo Carlini + + PR c++/57327 + * pt.c (unify_no_common_base): Swap arg and parm arguments to inform. + 2013-05-20 Paolo Carlini PR c++/10207 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b0be950b5908..7b80b915a964 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5375,7 +5375,7 @@ unify_no_common_base (bool explain_p, enum template_base_result r, { case tbr_ambiguous_baseclass: inform (input_location, " %qT is an ambiguous base class of %qT", - arg, parm); + parm, arg); break; default: inform (input_location, " %qT is not derived from %qT", arg, parm); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dfde009de2ac..52c52ac41d2a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-05-20 Paolo Carlini + + PR c++/57327 + * g++.dg/template/error50.C: New. + 2013-05-20 Paolo Carlini PR c++/10207 diff --git a/gcc/testsuite/g++.dg/template/error50.C b/gcc/testsuite/g++.dg/template/error50.C new file mode 100644 index 000000000000..d8702f8881d0 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/error50.C @@ -0,0 +1,19 @@ +// PR c++/57327 + +template +struct A {}; + +template +void f(A&) {} + +struct B : A {}; + +struct C : A {}; + +struct D : B, C {}; + +int main() +{ + D d; + f(d); // { dg-error "no matching" } +} // { dg-message "'A' is an ambiguous base" "" { target *-*-* } 18 }