From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4C50C385801D; Mon, 8 Jan 2024 13:23:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C50C385801D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704720193; bh=OizFHA5PbG7qF9HP2h4ClZ88AUFtQF+KwgIzvaHo/VA=; h=From:To:Subject:Date:From; b=A94jb+oUiBsXg7BQh1nST1Dwr/KJ/SVMU76powDfSAWmj94TCSHtYhGMv5km/Bfuv zfSZNyCl9aXPxFyrnQfRDZLsMcmmM/3P9POICMVxr4GmCmiPG0qCAUM7w7OYlu4JQm dAXA/6adEt7J16lMVwX2IO4xCBW46YlXO9+PKOhk= From: "fchelnokov at gmail dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fchelnokov at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113272 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 template struct A; template requires std::same_as struct A

: std::false_type {}; template requires std::same_as struct A

: std::true_type {}; int x =3D 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.=