From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5C654385C8B0; Fri, 30 Sep 2022 16:43:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C654385C8B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664556183; bh=5WYj+fmaIMAf+TU6y5aDwVGtL5RZ98Mxs6YXMSl+VLA=; h=From:To:Subject:Date:From; b=Bpyde/07PKk1i4xSJTL+kur5K42vNGrfk+SGqxhgCM0CMIeLPoLRxLstj6PDYzosg q58f352/ic0u1IKCuSnK29XAjXPRMrue7hClJ6LzsvwIfETxC+dxPkm/0FhmmIugZI ogMYHEUOXhULwUdLSzoEPAjHViz0njM28z6CzsK8= From: "me at inclyc dot cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107104] New: semantics of __builtin_constant_p within static_assert and return value Date: Fri, 30 Sep 2022 16:43:03 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: me at inclyc dot cn 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=3D107104 Bug ID: 107104 Summary: semantics of __builtin_constant_p within static_assert and return value Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: me at inclyc dot cn Target Milestone: --- https://godbolt.org/z/oz4e7bobT https://godbolt.org/z/hE6x9G49q illustrate different occasions about this issue.=20 Consider passing the same operand __builtin_constant_p in static assertions= and return value, expression with in static assertion passed, but the same expression evaluates to 0 as the return value. Are there some different scopes / contexts that causes different result? Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91158 Link: https://github.com/llvm/llvm-project/issues/58078=