]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/57327 ('derived' is an ambiguous base class of 'base' diagnostic is backwards)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 20 May 2013 09:44:20 +0000 (09:44 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 20 May 2013 09:44:20 +0000 (09:44 +0000)
/cp
2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/57327
* pt.c (unify_no_common_base): Swap arg and parm arguments to inform.

/testsuite
2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/57327
* g++.dg/template/error50.C: New.

From-SVN: r199097

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

index dd53e69d93823ba76a29b42990e9fc5b797369db..9d8ad5080ebb7fce4b90f290a7136d9cfbd39c5e 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/57327
+       * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
+
 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/10207
index b0be950b59085a92c5a16083a00d3e23e552a6bd..7b80b915a964193e77db48da447dda0cb400e09b 100644 (file)
@@ -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);
index dfde009de2ac2559baf2a30aae35a2d68c9338d0..52c52ac41d2a2f0c2c818c5d426d83291a987109 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/57327
+       * g++.dg/template/error50.C: New.
+
 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
 
        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 (file)
index 0000000..d8702f8
--- /dev/null
@@ -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 }
This page took 0.110685 seconds and 5 git commands to generate.