{
if (!equivalently_constrained (fn, method))
{
+ if (processing_template_decl)
+ /* We can't check satisfaction in dependent context, wait until
+ the class is instantiated. */
+ continue;
+
special_function_kind sfk = special_memfn_p (method);
- if (sfk == sfk_none || DECL_INHERITED_CTOR (fn))
- /* Non-special member functions coexist if they are not
- equivalently constrained. A member function is not hidden
- by an inherited constructor. */
+ if (sfk == sfk_none
+ || DECL_INHERITED_CTOR (fn)
+ || TREE_CODE (fn) == TEMPLATE_DECL)
+ /* Member function templates and non-special member functions
+ coexist if they are not equivalently constrained. A member
+ function is not hidden by an inherited constructor. */
continue;
/* P0848: For special member functions, deleted, unsatisfied, or
--- /dev/null
+// PR c++/95181
+// { dg-do compile { target concepts } }
+
+template <typename> struct f {
+ template <typename T=int> f();
+ template <typename T=int> requires false f();
+};
+
+f<int> a;