From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 13D28385701E; Tue, 5 Oct 2021 13:50:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13D28385701E From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98930] ICE with static variable in template function used as template argument Date: Tue, 05 Oct 2021 13:50:36 +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: ice-checking, ice-on-valid-code, link-failure 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 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: Tue, 05 Oct 2021 13:50:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98930 --- Comment #4 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:f3930418cb82000fae3cb4e98e870428800cf295 commit r12-4186-gf3930418cb82000fae3cb4e98e870428800cf295 Author: Patrick Palka Date: Tue Oct 5 09:50:02 2021 -0400 c++: templated static local var has value-dep addr [PR98930] Here uses_template_parms returns false for the dependent type A<&impl::= i>, which causes tsubst_aggr_type to think it's non-dependent and not bother substituting into it, leading to breakage. This patch fixes this by making has_value_dependent_address also return true for templated static local variables. PR c++/98930 gcc/cp/ChangeLog: * pt.c (has_value_dependent_address): Return true for a static local variable from a function template. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/nontype4.C: New test. * g++.dg/cpp1z/nontype4a.C: New test.=