From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D2B0D3858C62; Wed, 3 Jan 2024 13:07:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2B0D3858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704287252; bh=atKGGEpSmjvR0aULAFLIpH14n9H0/clTwsi/XvW+URE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SBbAYClzVwBadXmUOFNFV3uoud9hgGAOG8HDyCmeOKTPT0MgRJB2MotvPa++cBoux gFGTq36+v/GcT+FgSnhe0vcQHroiyzdx4IyPrnEpXm2aUU5Pn/zKa6D/IgDRxqoERL QW9X1Os1zdhnXQlIu1M7a9pd6rh4xUjFjJXTckLc= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/70248] constexpr initialization with unspecified equality expression accepted Date: Wed, 03 Jan 2024 13:07:32 +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: 6.0 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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: 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=3D70248 --- Comment #13 from Jonathan Wakely --- Although this is accepted even though it's in a template, so it's more complicated than just template vs non-template: template consteval void f( char const* p ) { char buf[N]{}; if (p =3D=3D buf) // unspecified return; for (int i =3D 0; i < 5; ++i) buf[i] =3D p[i]; } int main() { f("test"); }=