From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB1C33858C52; Fri, 19 May 2023 21:01:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB1C33858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684530095; bh=b3CMZjcjc1OtyWrsDdrK08a9mlzWJZpeGAmI9HE928I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Z5e4hWnpsqxsbj0ZPMeomPrB9arhCBV3l4I3SIn4fOEnKsyM1vQVwsGJtfOtzlq2K PpTiRFgDLiHn4e+81ixMvaIa2B/8D4azD2mUs1A4KKmnkadNlF10WHNy/dDXc23Umi 17olp7yld7BHKxot2OjgwzzuReT84WLxJDFFBj6A= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109876] [10/11/12/13/14 Regression] initializer_list not usable in constant expressions in a template Date: Fri, 19 May 2023 21:01:35 +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: 12.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 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=3D109876 --- Comment #7 from Marek Polacek --- // PR c++/109876 using size_t =3D decltype(sizeof 0); namespace std { template struct initializer_list { const int *_M_array; size_t _M_len; constexpr size_t size() const { return _M_len; } }; } // namespace std template struct Array {}; template void g() { static constexpr std::initializer_list num{2}; Array ctx; }=