]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: don't treat member var as var template
authorJason Merrill <jason@redhat.com>
Tue, 29 Jun 2021 19:11:25 +0000 (15:11 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 29 Jun 2021 20:50:23 +0000 (16:50 -0400)
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.

gcc/cp/pt.c

index f2039e09cd7c01862a1604cf641f6aa1c8a3c920..d2936c106ba2563c473b9055c4e8dab6b2be5261 100644 (file)
@@ -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);