From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 033673858C60; Fri, 15 Sep 2023 17:09:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 033673858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694797750; bh=AXI82ng83+D0sL1wQxCOPwaOJq3F/bbZ8U4RDiyKurI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QpDe/H2kp40XvpOWdNcnLvuxzzDsehE1xZQb5I3Di+5k3juTPai2zoJpSYII17udo tMb611so/c3Sp1xPjjS1xn2Kre17jKVyd2fp64WG/WMo+4PP/GHngIlm0AxFRs0n+m 3fK4NBj+wmHhDC9N24DC0gAiwKbKeEKq9QCFn0jw= From: "malekwryyy at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111421] constexpr not working with array subscript Date: Fri, 15 Sep 2023 17:09:09 +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: malekwryyy at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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 #3 from Abdulmalek Almkainzi --- (In reply to joseph@codesourcery.com from comment #1) > 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 implementation= s=20 > to accept such an example if they so choose). Alright, I see how this is not a GCC bug and instead part of the standard.= =20 But may I ask how this is even the case? the expression is constant and can= be evaluated at compile time.=