===================================================================
@@ -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 }
===================================================================
@@ -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;
}