Wrong processing of overloaded set within requires-expression (original) (raw)
This program
void f();
void f(int);
template<typename T>
concept C = sizeof(T) == 42;
// accepted by Clang, but why?
static_assert( requires {{ &f } -> C;} );
looks ill formed because &f is an address of overloaded function. And the program is rejected by GCC and MSVC, but Clang accepts it. Online demo: https://gcc.godbolt.org/z/99q9M5afY