commit 32ca2088d87e3a3204cc28f4d7fa543d5616f8b6
Author: Jason Merrill <jason@redhat.com>
Date: Wed Jan 11 09:05:31 2012 -0500
PR c++/51613
* pt.c (resolve_overloaded_unification): Compare types with
same_type_p, not decls_match.
@@ -15471,7 +15471,7 @@ resolve_overloaded_unification (tree tparms,
elem = tsubst (TREE_TYPE (fn), subargs, tf_none, NULL_TREE);
if (try_one_overload (tparms, targs, tempargs, parm,
elem, strict, sub_strict, addr_p, explain_p)
- && (!goodfn || !decls_match (goodfn, elem)))
+ && (!goodfn || !same_type_p (goodfn, elem)))
{
goodfn = elem;
++good;
new file mode 100644
@@ -0,0 +1,24 @@
+// PR c++/51613
+
+template<typename F, typename T>
+void apply(F f, T t)
+{
+ f(t);
+}
+
+template<typename T>
+void multi(T)
+{
+}
+
+template<typename T>
+void multi(T*)
+{
+}
+
+int main()
+{
+ apply(&multi<int>, 7); // { dg-error "no match" }
+
+ return 0;
+}
commit a03d5b81f06edbe8b919baa4791f2d52ef223582
Author: Jason Merrill <jason@redhat.com>
Date: Wed Jan 11 09:05:49 2012 -0500
* decl.c (decls_match): Assert that the arguments are decls.
@@ -952,6 +952,8 @@ decls_match (tree newdecl, tree olddecl)
interested in their types. */
return 0;
+ gcc_assert (DECL_P (newdecl));
+
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
tree f1 = TREE_TYPE (newdecl);