public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jlame646 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107605] New: GCC rejects valid program involving std::bind and requires Date: Thu, 10 Nov 2022 08:06:17 +0000 [thread overview] Message-ID: <bug-107605-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107605 Bug ID: 107605 Summary: GCC rejects valid program involving std::bind and requires Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jlame646 at gmail dot com Target Milestone: --- The following valid program(afaik) is rejected by gcc but accepted by clang. Demo: https://godbolt.org/z/bdMfKE41n ``` template <typename T> class myclass { public: void func(const T&) requires true { std::cout << "true"; } void func(const T&) requires false { std::cout << "false"; } }; int main(){ myclass<int> obj; auto mylambda = std::bind(&myclass<int>::func, &obj, 5); //accepted by clang rejected by gcc mylambda(); } ``` The error says: ``` error: no matching function for call to 'bind(<unresolved overloaded function type>, myclass<int>*, int)' 24 | auto mylambda = std::bind(&myclass<int>::func, &obj, 5); //accepted by clang rejected by gcc ``` This has been discussed here: https://stackoverflow.com/questions/74385849/clang-accepts-program-involving-requires-constraint-while-gcc-and-msvc-rejects-i
next reply other threads:[~2022-11-10 8:06 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-10 8:06 jlame646 at gmail dot com [this message] 2022-11-10 12:05 ` [Bug c++/107605] " redi at gcc dot gnu.org 2022-11-10 12:50 ` [Bug c++/107605] GCC rejects valid program involving requires-clause jlame646 at gmail dot com 2022-11-10 13:49 ` redi at gcc dot gnu.org 2022-11-10 23:15 ` [Bug c++/107605] constraint on a member function does causes ambigious and not allowing forming a pointer to the function pinskia at gcc dot gnu.org 2022-11-10 23:20 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-107605-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).