https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98930
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:f3930418cb82000fae3cb4e98e870428800cf295 commit r12-4186-gf3930418cb82000fae3cb4e98e870428800cf295 Author: Patrick Palka <ppa...@redhat.com> 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.