This code won't compile with GCC ///////////////////////////////////////////////////// template <class T> struct A { void f() requires std::is_same_v<T, int> { } void f(int) requires !std::is_same_v<T, int> { } }; int main() { auto fptr = &A<int>::f; return 0; } ///////////////////////////////////////////////////// According to the discussion here, it should be valid: http://stackoverflow.com/q/43793941/4447365
Created attachment 53185 [details] Updated full testcase
clang accepts this while MSVC rejects this for the same reason as GCC.
*** Bug 107605 has been marked as a duplicate of this bug. ***
Reduced testcase from the dup bug: extern "C" int puts(const char*); template <typename T> class myclass { public: void func(const T&) requires true { puts("true"); } void func(const T&) requires false { puts("false"); } }; auto mylambda = &myclass<int>::func;
(In reply to Andrew Pinski from comment #4) > Reduced testcase from the dup bug: Oh MSVC still rejects this reduced testcase for the same reason as GCC. <source>(19): error C3535: cannot deduce type for 'auto' from 'overloaded-function'