From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0F3393858D35; Thu, 16 Nov 2023 00:49:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F3393858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700095747; bh=eCF/owyKS98JNt1hIT41t7BJlBwFiMgINiYUDN3zW9Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PtDwI/U+wR818UMP+q9JsCSA3K+D28qi1GP6/WGXc3ynFZDqTJ549MtVGKykC/zI9 +J6vGc5pKYUyz5xS/A1ezUBfAEeHPZC1wIyIxl16cjg+mLWN0KQdqcvFKaDjN9neo0 PUT5O18DTe/W+Px7NdCT2zqPBTPCNCZuQZqg1oOo= From: "arthur.j.odwyer at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99524] initializer_list storage considered a temporary when accessed through NTTP Date: Thu, 16 Nov 2023 00:49:06 +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: 11.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: arthur.j.odwyer at gmail 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: cc 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=3D99524 Arthur O'Dwyer changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.j.odwyer at gmail d= ot com --- Comment #1 from Arthur O'Dwyer --- I don't see this as a bug (and indeed Clang/MSVC reject it too). It's okay = to use the address of `il` itself as the value of a template parameter, becaus= e we know a mangleable name for that; but the address of the first element of the backing array isn't a valid value for a template parameter, because the bac= king array is anonymous =E2=80=94 it hasn't got a mangleable name =E2=80=94 in t= he very-new-like-as-of-last-week Standardese, it's a "potentially non-unique object." The same rejection applies to this example employing a string lite= ral (the other kind of "potentially non-unique object") in the Standard post-CWG2753): constexpr const char *il =3D "hello world"; template constexpr bool front =3D true; static_assert(front<&il>); // OK static_assert(front<&il[0]>); // Reject So I think this is not-a-bug.=