From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 993E43844070; Mon, 27 Jul 2020 15:35:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 993E43844070 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595864154; bh=n06hpK9XtcamzIOa1fcLULYovGKhB2T4BXgHAPvOeLo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jtbvMVtNmOHf5BB/kSiKAm74tMJ6Ep/7Bqm3AgqFjjyuQ4JQ4y/n4F6knWAOhiYls 0NN+JU4/jurnRG57tDOoeg5psfc3UQucM7xmypSEC01VwSMPzS2MPBXiyds7rJGsB7 92SCfWehQSJhwf2AVuxUTV/DnXxCyjwacqDWmqUY= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96330] Constexpr variables cannot be used in the template context. Date: Mon, 27 Jul 2020 15:35:54 +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: 10.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 15:35:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96330 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- Tried --- gcc/cp/pt.c.jj 2020-07-27 10:38:19.000000000 +0200 +++ gcc/cp/pt.c 2020-07-27 17:25:09.748240198 +0200 @@ -16838,14 +16838,17 @@ tsubst_copy (tree t, tree args, tsubst_f case TEMPLATE_ID_EXPR: { /* Substituted template arguments */ - tree fn =3D TREE_OPERAND (t, 0); + tree expr =3D TREE_OPERAND (t, 0); tree targs =3D TREE_OPERAND (t, 1); - fn =3D tsubst_copy (fn, args, complain, in_decl); + expr =3D tsubst_copy (expr, args, complain, in_decl); if (targs) targs =3D tsubst_template_args (targs, args, complain, in_decl); - return lookup_template_function (fn, targs); + if (variable_template_p (expr)) + return lookup_and_finish_template_variable (expr, targs, complain= ); + else + return lookup_template_function (expr, targs); } case TREE_LIST: but that just means an ICE elsewhere.=