/* Might be trivial. */;
else if (TREE_CODE (fn) == TEMPLATE_DECL)
/* Templates are never special members. */;
- else if (!constraints_satisfied_p (fn))
- /* Not eligible. */;
- else if (copy_fn_p (fn))
+ else if (copy_fn_p (fn)
+ && constraints_satisfied_p (fn))
TYPE_HAS_COMPLEX_COPY_CTOR (t) = true;
- else if (move_fn_p (fn))
+ else if (move_fn_p (fn)
+ && constraints_satisfied_p (fn))
TYPE_HAS_COMPLEX_MOVE_CTOR (t) = true;
}
/* Might be trivial. */;
else if (TREE_CODE (fn) == TEMPLATE_DECL)
/* Templates are never special members. */;
- else if (!constraints_satisfied_p (fn))
- /* Not eligible. */;
- else if (copy_fn_p (fn))
+ else if (copy_fn_p (fn)
+ && constraints_satisfied_p (fn))
TYPE_HAS_COMPLEX_COPY_ASSIGN (t) = true;
- else if (move_fn_p (fn))
+ else if (move_fn_p (fn)
+ && constraints_satisfied_p (fn))
TYPE_HAS_COMPLEX_MOVE_ASSIGN (t) = true;
}
}
--- /dev/null
+// PR c++/108579
+// { dg-do compile { target c++20 } }
+
+template<class T>
+struct A {
+ A(double, char);
+ A(int) requires requires { A(0.0, 'c'); };
+ A& operator=(int) requires requires { A(1.0, 'd'); };
+};
+
+int main() {
+ A<int> a(3);
+ a = 5;
+}