if (*candidates && (*candidates)->fn == totype)
return NULL;
+ if (!constraints_satisfied_p (fn))
+ {
+ reason = constraint_failure ();
+ viable = 0;
+ return add_candidate (candidates, fn, obj, arglist, len, convs,
+ access_path, conversion_path, viable, reason, flags);
+ }
+
for (i = 0; i < len; ++i)
{
tree arg, argtype, convert_type = NULL_TREE;
--- /dev/null
+// PR c++/110535
+// { dg-do compile { target c++20 } }
+
+using F = int(int);
+
+template<bool B>
+struct A {
+ operator F*() requires B;
+};
+
+int i = A<true>{}(0); // OK
+int j = A<false>{}(0); // { dg-error "no match" }
--- /dev/null
+// PR c++/110535
+// { dg-do compile { target c++20 } }
+
+using F = int(int);
+using G = long(int);
+
+template<bool B>
+struct A {
+ operator F&() requires B;
+ operator G&() requires (!B);
+};
+
+int i = A<true>{}(0); // { dg-bogus "ambiguous" }
+int j = A<false>{}(0); // { dg-bogus "ambiguous" }