§14.10.3 Partial ordering by constraints [temp.constr.order] of N4553 specifies that constraint expressions formed of concepts and logical operators should be partially ordered and used to select the best viable function in cases of overloading. But does this also apply to constraint expressions using fold expressions of logical operators?
For example, is gcc correct to give an ambiguous overload error here or is the code valid, printing "c"?
template <class T> concept bool A = std::is_move_constructible<T>::value;
template <class T> concept bool B = std::is_copy_constructible<T>::value;
template <class T> concept bool C = A<T> && B<T>;
template <class... _tx>
requires (A<_tx> && ...)
void g(_tx... tx) {
std::cout << "a\n";
}
template <class... _tx>
requires (C<_tx> && ...)
void g(_tx... tx) {
std::cout << "c\n";
}
f(3, 2.0)