re PR c++/71075 (Broken diagnostic: 'integer_cst' not supported by 'dump_decl')
authorMarek Polacek <polacek@redhat.com>
Thu, 19 May 2016 20:23:52 +0000 (20:23 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 19 May 2016 20:23:52 +0000 (20:23 +0000)
PR c++/71075
* pt.c (unify_template_argument_mismatch): Use %qE instead of %qD.

* g++.dg/diagnostic/pr71075.C: New test.

From-SVN: r236487

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

index 5c38aaf9b57af2bb8d2bfc6b7e3fcb7e1ccb32c7..dcd660f627c0d1032a87dacc1553a419072fe8db 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-19  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/71075
+       * pt.c (unify_template_argument_mismatch): Use %qE instead of %qD.
+
 2016-05-19  Jason Merrill  <jason@redhat.com>
 
        PR c++/10200
index 39085927e8602bb6d33daf362de651eac3ad0cc7..2bba571b97e37cd7de58a75602172a137cd21a6a 100644 (file)
@@ -6165,7 +6165,7 @@ unify_template_argument_mismatch (bool explain_p, tree parm, tree arg)
 {
   if (explain_p)
     inform (input_location,
-           "  template argument %qE does not match %qD", arg, parm);
+           "  template argument %qE does not match %qE", arg, parm);
   return 1;
 }
 
index 1630598fe3124b14a510c180c226a8016cc81780..41668728f078deb22442d6fd81ac7b72d13eb68a 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-19  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/71075
+       * g++.dg/diagnostic/pr71075.C: New test.
+
 2016-05-19  David Malcolm  <dmalcolm@redhat.com>
 
        PR c++/71184
diff --git a/gcc/testsuite/g++.dg/diagnostic/pr71075.C b/gcc/testsuite/g++.dg/diagnostic/pr71075.C
new file mode 100644 (file)
index 0000000..6bb1e68
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/71075
+
+template<typename T, int I> struct A {};
+template<typename T> void foo(A<T,1>) {}
+int main() {
+  foo(A<int,2>()); // { dg-error "no matching" }
+// { dg-message "template argument .2. does not match .1." "" { target *-*-* } 6 }
+}