Hi,
a simple issue noticed by Jon, swap the arguments to inform. Tested
x86_64-linux.
Thanks,
Paolo.
////////////////////////
/cp
2013-05-19 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/57327
* pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
/testsuite
2013-05-19 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/57327
* g++.dg/template/error50.C: New.
Index: cp/pt.c
===================================================================
--- cp/pt.c (revision 199076)
+++ cp/pt.c (working copy)
@@ -5375,7 +5375,7 @@ unify_no_common_base (bool explain_p, enum templat
{
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);
Index: testsuite/g++.dg/template/error50.C
===================================================================
--- testsuite/g++.dg/template/error50.C (revision 0)
+++ testsuite/g++.dg/template/error50.C (working copy)
@@ -0,0 +1,19 @@
+// PR c++/57327
+
+template<class T>
+struct A {};
+
+template<class T>
+void f(A<T>&) {}
+
+struct B : A<long> {};
+
+struct C : A<char> {};
+
+struct D : B, C {};
+
+int main()
+{
+ D d;
+ f(d); // { dg-error "no matching" }
+} // { dg-message "'A<T>' is an ambiguous base" "" { target *-*-* } 18 }