]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/51367 (Broken diagnostic: 'pointer_type' not supported by dump_expr)
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 1 Dec 2011 09:34:43 +0000 (09:34 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 1 Dec 2011 09:34:43 +0000 (09:34 +0000)
/cp
2011-12-01  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/51367
* pt.c (unify_inconsistency): Use either %qT or %qE depending on
whether parm is a type or non-type parameter.

/cp
2011-12-01  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/51367
* g++.dg/template/error47.C: New.

From-SVN: r181876

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

index 55addacfe464d945523c99809f15b7064942a3dd..998303417d257c1dcde00e306abf799bee83c71e 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-01  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/51367
+       * pt.c (unify_inconsistency): Use either %qT or %qE depending on
+       whether parm is a type or non-type parameter.
+
 2011-11-30  Jason Merrill  <jason@redhat.com>
 
        PR c++/51009
index 472508075776e109d0636e4c100fddd7edded127..15ef7a0caeadd23d9e8a813894b99cf5c0e12454 100644 (file)
@@ -5501,9 +5501,16 @@ static int
 unify_inconsistency (bool explain_p, tree parm, tree first, tree second)
 {
   if (explain_p)
-    inform (input_location,
-           "  conflicting deductions for parameter %qE (%qE and %qE)",
-           parm, first, second);
+    {
+      if (TYPE_P (parm))
+       inform (input_location,
+               "  deduced conflicting types for parameter %qT (%qT and %qT)",
+               parm, first, second);
+      else
+       inform (input_location,
+               "  deduced conflicting values for non-type parameter "
+               "%qE (%qE and %qE)", parm, first, second);
+    }
   return 1;
 }
 
index 8e29dab0ade33c36e4f3b084409273d4932e1f5f..db9afc16709b2534665614cebc832cbfd92a8a9b 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-01  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/51367
+       * g++.dg/template/error47.C: New.
+
 2011-11-30  Jason Merrill  <jason@redhat.com>
 
        PR c++/51009
diff --git a/gcc/testsuite/g++.dg/template/error47.C b/gcc/testsuite/g++.dg/template/error47.C
new file mode 100644 (file)
index 0000000..7e360fe
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/51367
+
+template<typename T> void foo(T, T); // { dg-message "template" }
+
+void bar(void* p)
+{
+  foo(0, p); // { dg-error "no matching" }
+}
+// { dg-message "candidate|parameter 'T' ('int' and 'void*')" { target *-*-* } 7 }