public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "fchelnokov at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113272] New: Wrong specialization of class template selected Date: Mon, 08 Jan 2024 13:23:12 +0000 [thread overview] Message-ID: <bug-113272-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113272 Bug ID: 113272 Summary: Wrong specialization of class template selected Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fchelnokov at gmail dot com Target Milestone: --- This program #include <concepts> template <auto> struct A; template <auto p> requires std::same_as<decltype(p), const int*> struct A<p> : std::false_type {}; template <auto p> requires std::same_as<decltype(p), int*> struct A<p> : std::true_type {}; int x = 0; static_assert( A<&x>::value ); ///< try to comment this line static_assert( !A<(const int *)&x>::value ); ///< GCC fails here is accepted by Clang and MSVC, but GCC erroneously evaluates the last line. Online demo: https://godbolt.org/z/5Pqx6TG3W But if one comments the previous static_assert, then it starts working.
next reply other threads:[~2024-01-08 13:23 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-01-08 13:23 fchelnokov at gmail dot com [this message] 2024-01-08 15:52 ` [Bug c++/113272] " pinskia at gcc dot gnu.org 2024-01-09 14:41 ` mpolacek at gcc dot gnu.org 2024-01-09 14:56 ` fchelnokov at gmail dot com 2024-01-10 0:12 ` 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-113272-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).