+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
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;
}
--- /dev/null
+// 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 }