This testcase demonstrates that the issue in PR105623 is not limited to
templates, so we should do the marking in a less template-specific place.
PR c++/105779
gcc/cp/ChangeLog:
* call.cc (resolve_args): Call mark_single_function here.
* pt.cc (unify_one_argument): Not here.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1y/auto-fn63.C: New test.
}
else if (invalid_nonstatic_memfn_p (EXPR_LOCATION (arg), arg, complain))
return NULL;
+
+ /* Force auto deduction now. Omit tf_warning to avoid redundant
+ deprecated warning on deprecated-14.C. */
+ if (!mark_single_function (arg, tf_error))
+ return NULL;
}
return args;
}
return unify_success (explain_p);
}
- /* Force auto deduction now. Use tf_none to avoid redundant
- deprecated warning on deprecated-14.C. */
- mark_single_function (arg, tf_none);
-
arg_expr = arg;
arg = unlowered_expr_type (arg);
if (arg == error_mark_node)
--- /dev/null
+// PR c++/105779
+// { dg-do compile { target c++14 } }
+
+template<int>
+struct struct1
+{
+ static auto apply() { return 1; }
+};
+
+int method(int(*f)());
+
+int t = method(struct1<1>::apply);