From: Jason Merrill Date: Tue, 29 Jun 2021 19:11:25 +0000 (-0400) Subject: c++: don't treat member var as var template X-Git-Tag: basepoints/gcc-13~6394 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=362347c5a4e56d48c9af7ed7d9cc3feff0c2d219;p=thirdparty%2Fgcc.git c++: don't treat member var as var template While looking at a partial instantiation issue I noticed that we were wrongly hitting the partial instantiation code when instantiating a static data member of a class template. I don't think this broke anything, but we don't need to do that (small) extra work. gcc/cp/ChangeLog: * pt.c (instantiate_decl): Only consider partial specializations of actual variable templates. --- diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f2039e09cd7c..d2936c106ba2 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -26003,7 +26003,7 @@ instantiate_decl (tree d, bool defer_ok, bool expl_inst_class_mem_p) td = template_for_substitution (d); args = gen_args; - if (VAR_P (d)) + if (variable_template_specialization_p (d)) { /* Look up an explicit specialization, if any. */ tree tid = lookup_template_variable (gen_tmpl, gen_args);