From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A0DF13858D35; Sat, 15 Jan 2022 09:19:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0DF13858D35 From: "bugzilla at cems dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104041] static_assert failure triggered by non-selected template specialization Date: Sat, 15 Jan 2022 09:19:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bugzilla at cems dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED 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: resolution Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2022 09:19:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104041 bugzilla at cems dot de changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED --- Comment #2 from bugzilla at cems dot de --- (In reply to Andrew Pinski from comment #1) > Since the value that is done in the static_assert is not value dependent,= it > is rejected at the definition time of C::C. >=20 > This is correct.=20 So if I replace the condition in the static_assert by something which is va= lue dependent,it will not be triggered in an unselected specialization even if = the condition is always false, e.g.: static_assert(sizeof(T) < 0, "C selected"); OK, thanks.=