From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5B629385843A; Mon, 21 Nov 2022 07:58:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B629385843A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669017530; bh=JBYOCkWrNTGOcG2vV2pSBZseP+Jyz6rZrdTwxLs1nuU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TaQM9xmg59i1T6TTDbZbgzYJulBBTRDr6ltDnVcc1jkkc8D8yIN9XxctfEVMmY+5C +UyVv6bqq4K3nm1Vxl/4RvBIiUtfuEuc9dI7c+dX6u+S5Q0Ji2b09bi6dPmO0efAp9 TKlAWH9h437T1SjipPQEjeldiJbJYV3QSNzzI1jY= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/87497] constexprs involving non-literal const variables are incorrectly accepted Date: Mon, 21 Nov 2022 07:58:49 +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: 8.2.1 X-Bugzilla-Keywords: accepts-invalid, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: keywords 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D87497 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |needs-bisection --- Comment #2 from Andrew Pinski --- Seems to be fixed on the trunk. I get now: : In function 'void g()': :3:63: in 'constexpr' expansion of 'foo(local_s)' :3:71: error: the value of 'local_s' is not usable in a constant expression 3 | void g () { const s local_s =3D { 1, 2 }; constexpr int a =3D foo (local_s); } | = ^ :3:21: note: 'local_s' was not declared 'constexpr' 3 | void g () { const s local_s =3D { 1, 2 }; constexpr int a =3D foo (local_s); } | ^~~~~~~=