public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1919] c++: don't treat member var as var template
@ 2021-06-29 20:51 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2021-06-29 20:51 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:362347c5a4e56d48c9af7ed7d9cc3feff0c2d219
commit r12-1919-g362347c5a4e56d48c9af7ed7d9cc3feff0c2d219
Author: Jason Merrill <jason@redhat.com>
Date: Tue Jun 29 15:11:25 2021 -0400
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:
---
gcc/cp/pt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f2039e09cd7..d2936c106ba 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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-29 20:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 20:51 [gcc r12-1919] c++: don't treat member var as var template Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).