From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B4C813858C00; Fri, 15 Sep 2023 17:21:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4C813858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694798463; bh=hUsKHfqxRBs9p0wQfWgv/OQsyrz68njclHYVMssAmrw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Zif5dil8+yrLZX75UNPBl1wlapLIhR8I6KD1QZLEdXu1ZYvGHUBO1RuPXtUCZ2n0O 0e7eMKlomRiEUXqzubGLYk6xNFKUGFOJy4u5ipag6SmkqP69Tx3tN4UQRwEreTjmad BZO0Pq8EFN5z+oiKOb1IiSl2Xvq9LsKdh9BVwLYE= 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 17:21:03 +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: 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 #4 from joseph at codesourcery dot com --- The definition of constexpr in C2x is intentionally minimal, with=20 potential for future expansion in subsequent standard revisions.=20=20 Allowing array element accesses would run into needing an appropriate=20 definition of exactly what cases are allowed and don't count as accessing=20 the value of an object (presumably including requiring the array element=20 index itself to be an integer constant expression within range for the=20 array in question).=