Open
Description
From http://wg21.link/cwg2369 , https://gcc.godbolt.org/z/nEqhM5dsG
The changes are already in the draft, starting here (https://eel.is/c++draft/temp.deduct.general#5.sentence-8) till the end of that paragraph.
template <class T> struct Z {
typedef typename T::x xx;
};
template <class T> concept C = requires { typename T::A; };
template <C T> typename Z<T>::xx f(void *, T); // #1
template <class T> void f(int, T); // #2
struct A {} a;
struct ZZ {
template <class T, class = typename Z<T>::xx> operator T *();
operator int();
};
int main() {
ZZ zz;
f(1, a); // OK, deduction fails for #1 because there is no conversion from int to void*
f(zz, 42); // OK, deduction fails for #1 because C<int> is not satisfied
}
compiles with GCC 11 and newer, but fails with clang-trunk and GCC 10 and older because they don't implement the CWG2369.
Metadata
Metadata
Assignees
Type
Projects
Status
Done