summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-14 20:23:45 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-14 20:23:45 +0000
commit1ab0a87c7ef3802a8e3d4e142020a7464e51e739 (patch)
tree09d42cfe8eb3dcab500f5eccf86ca247c14168ab /gcc
parent25543ef4205fb89a2c9604fa71d0a783f64a4683 (diff)
downloadgcc-1ab0a87c7ef3802a8e3d4e142020a7464e51e739.tar.gz
* pt.c (lookup_template_class): Add comment.
(instantiate_class_template): Don't mark the _TYPE node for member class templates as an instantiation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23092 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c15
2 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 87e97623267..0e5b319822e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+1998-10-14 Mark Mitchell <mark@markmitchell.com>
+
+ * pt.c (lookup_template_class): Add comment.
+ (instantiate_class_template): Don't mark the _TYPE node for
+ member class templates as an instantiation.
+
1998-10-14 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokfndecl): Fix my thinko.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index ea021fa8025..c836fbd4505 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -3547,7 +3547,9 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope)
push_obstacks (&permanent_obstack, &permanent_obstack);
/* This type is a "partial instantiation" if any of the template
- arguments still inolve template parameters. */
+ arguments still inolve template parameters. Note that we set
+ IS_PARTIAL_INSTANTIATION for partial specializations as
+ well. */
is_partial_instantiation = uses_template_parms (arglist);
/* Create the type. */
@@ -4519,6 +4521,17 @@ instantiate_class_template (type)
newtag = tsubst (tag, args, NULL_TREE);
if (TREE_CODE (newtag) != ENUMERAL_TYPE)
{
+ if (TYPE_LANG_SPECIFIC (tag) && CLASSTYPE_IS_TEMPLATE (tag))
+ /* Unfortunately, lookup_template_class sets
+ CLASSTYPE_IMPLICIT_INSTANTIATION for a partial
+ instantiation (i.e., for the type of a member template
+ class nested within a template class.) This behavior is
+ required for maybe_process_partial_specialization to work
+ correctly, but is not accurate in this case; the TAG is not
+ an instantiation of anything. (The corresponding
+ TEMPLATE_DECL is an instantiation, but the TYPE is not.) */
+ CLASSTYPE_USE_TEMPLATE (newtag) = 0;
+
/* Now, we call pushtag to put this NEWTAG into the scope of
TYPE. We first set up the IDENTIFIER_TYPE_VALUE to avoid
pushtag calling push_template_decl. We don't have to do