From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2C3E33840115; Sat, 17 Dec 2022 16:25:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C3E33840115 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671294307; bh=rBBHlPlLlCiVfSIg6vEvIST7LunD8urcmMGT6Nfyl7o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MOC/WkuorJcCtxT+Y5aZU+uESngJj2KzleGl9GK6U8SpO5k7qkV003sjY449d6dhe lbn3QlKaHDtBnkZ08XgHDdGw2ToJ6L3g6qlw6sTtAlRfvJy9l1/ZcULRZhIjrjhpOt IBmWu8URcqyKbWSCY0zF1obVvbnKC+cV/epKLXIg= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/87765] Internal compiler error: coerce_template_parms (8.2) or cxx_eval_constant_expression (trunk) Date: Sat, 17 Dec 2022 16:25:03 +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: 8.2.0 X-Bugzilla-Keywords: ice-on-valid-code, monitored X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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=3D87765 --- Comment #8 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:982629bea416df976686467f235e09cb1a5531cc commit r13-4761-g982629bea416df976686467f235e09cb1a5531cc Author: Patrick Palka Date: Sat Dec 17 11:24:44 2022 -0500 c++: constantness of non-dependent NTTP argument [PR107437] Here we're rejecting the use of the lambda capture of 't' (of empty type) as a template argument ultimately because convert_nontype_argument checks constantness using is_constant_expression, which returns false for lambda captures since want_rval=3Dfalse. But in this case I believe an lvalue-to-rvalue conversion of the argument is implied, so we should be using is_rvalue_constant_expression instead (which would return true here). However, it doesn't seem necessary to consider constantness at all when deciding whether to instantiate a non-dependent argument in convert_nontype_argument. So this patch gets rid of the problematic constantness test altogether, which incidentally also fixes the similar dg-ice'd testcase from PR87765. This is in line with a similar change we made to finish_decltype_type in r12-7564-gec0f53a3a542e7. PR c++/107437 PR c++/87765 gcc/cp/ChangeLog: * pt.cc (convert_nontype_argument): Relax is_nondep_const_expr test to !inst_dep_expr_p. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/lambda-generic-107437.C: New test. * g++.dg/cpp1z/constexpr-lambda26.C: Remove dg-ice.=