From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5AC9C3858024; Fri, 15 Sep 2023 16:54:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5AC9C3858024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694796892; bh=Pa/c6xis7PXPbFYoELyiH2zE6HiIPWXXRThxUN74Qrk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mD2dLUWt1/OPt+H3bzWqpLO/1K5m9hz38IFJLsEPcCfviddI/WHk86lKHaNtDQma9 C9aDl87UPi9btF/5ggqteWdiED2Fza437zhFVfLOCBJfIqqAbOqknMaKJIUIeTvLAk orb5S3d5Ok5rCQqYSlNE2lSnDwHgYZvAoIQ82srs= From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111421] constexpr not working with array subscript Date: Fri, 15 Sep 2023 16:54:52 +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: 13.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery 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: 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=3D111421 --- Comment #1 from joseph at codesourcery dot com --- See the definitions of "named constant" and "compound literal constant".=20= =20 Array element accesses aren't allowed, and the example you have with "->"=20 shouldn't be accepted either (although the standard rules for=20 implementation-defined constant expressions probably allow implementations= =20 to accept such an example if they so choose).=