From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F9AC3858C62; Thu, 18 May 2023 17:26:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F9AC3858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684430776; bh=G2jA8pGMQG+WkphhR/2Zcz4+RnyA1h+Y4PjU3FCUK/w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=W1W5sm13Pvs6O+xkFmnqPdpKrIJCf8hvpL+sHRDeVXQ3kRl9Umuf6mdK52qoS0sB8 32htr//swtwYOwLWCQJBAZaHdfY9/SGPum6ZFE4a/KNYPRT00oeogl3tgzi9I9qFMA PgxJH4T6uYaWprtiYfM86pPy+yyPauFTtCWg8Uk4= From: "jason 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: Thu, 18 May 2023 17:26:15 +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: jason 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: 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=3D109876 Jason Merrill changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #6 from Jason Merrill --- (In reply to Patrick Palka from comment #5) > Seems related to PR89144 too -- there we were mishandling defining a > non-dependent static std::initializer_list member variable, here we're > subsequently trying to use it. The issue there is that the initializer_list wasn't static, but here it is,= so the array temporary should be as well. And presumably the problem is that = we aren't representing that lifetime extension in a template. And checking the initializer gives up on trying to enforce that. But then when we try to evaluate the template argument we find that we don't have a constant value = to work with, and complain.=20=20 Instead, we should probably treat num as value-dependent even though it actually isn't. Or fix it to be properly evaluated by representing the lifetime extension somehow.=