https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107605
Jason Liam <jlame646 at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|GCC rejects valid program |GCC rejects valid program |involving std::bind and |involving requires-clause |requires | --- Comment #2 from Jason Liam <jlame646 at gmail dot com> --- (In reply to Jonathan Wakely from comment #1) > This has nothing to do with std::bind. > Yes i know this has nothing to do with `std::bind`. For example, I created the following demo that reproduces the same error without std::bind. See demo: https://godbolt.org/z/K6jKqsGx5 . I also mentioned the same in one of my comments here: https://stackoverflow.com/questions/74385849/clang-accepts-program-involving-requires-constraint-while-gcc-and-msvc-rejects-i/74386905#comment131319278_74385849 . I've edited the title of this bug. ``` template <typename T> class myclass { public: void func(const T&) requires true { std::cout << "true"; } void func(const T&) requires false { std::cout << "false"; } }; template<typename T> void bar(T&& ) { } int main(){ myclass<int> obj; bar(&myclass<int>::func); //accepted by clang but rejected by gcc and msvc } ```