aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2001-07-06 06:36:47 +0000
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>2001-07-06 06:36:47 +0000
commitdac655014e1c2260c7b55b2c3dcc0e8f9678aaef (patch)
tree4ab6e0a3c0db731c148fb90ee146d4bbc2222c30 /gcc
parentaf418b8cb81e526c2a2d5f9195f26af1d6e722a3 (diff)
downloadgcc-dac655014e1c2260c7b55b2c3dcc0e8f9678aaef.zip
gcc-dac655014e1c2260c7b55b2c3dcc0e8f9678aaef.tar.gz
gcc-dac655014e1c2260c7b55b2c3dcc0e8f9678aaef.tar.bz2
cp-tree.h (copy_template_template_parm): Rename to ...
* cp-tree.h (copy_template_template_parm): Rename to ... (bind_template_template_parm): ... here. * tree.c (copy_template_template_parm): Rename to ... (bind_template_template_parm): ... here. Remove the case when NEWARGS is NULL_TREE. (copy_tree_r): Don't copy TEMPLATE_TEMPLATE_PARM and BOUND_TEMPLATE_TEMPLATE_PARM. * pt.c (lookup_template_class): Adjust. From-SVN: r43800
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog11
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/pt.c3
-rw-r--r--gcc/cp/tree.c44
4 files changed, 26 insertions, 34 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5e6195c..eb0e0eb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,14 @@
+2001-07-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * cp-tree.h (copy_template_template_parm): Rename to ...
+ (bind_template_template_parm): ... here.
+ * tree.c (copy_template_template_parm): Rename to ...
+ (bind_template_template_parm): ... here. Remove the case when
+ NEWARGS is NULL_TREE.
+ (copy_tree_r): Don't copy TEMPLATE_TEMPLATE_PARM and
+ BOUND_TEMPLATE_TEMPLATE_PARM.
+ * pt.c (lookup_template_class): Adjust.
+
2001-07-05 Jason Merrill <jason_merrill@redhat.com>
* cvt.c (convert_lvalue): New fn.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 2ccb3b7..66ce4fb 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4355,7 +4355,7 @@ extern int promotes_to_aggr_type PARAMS ((tree, enum tree_code));
extern int is_aggr_type_2 PARAMS ((tree, tree));
extern const char *lang_printable_name PARAMS ((tree, int));
extern tree build_exception_variant PARAMS ((tree, tree));
-extern tree copy_template_template_parm PARAMS ((tree, tree));
+extern tree bind_template_template_parm PARAMS ((tree, tree));
extern tree array_type_nelts_total PARAMS ((tree));
extern tree array_type_nelts_top PARAMS ((tree));
extern tree break_out_target_exprs PARAMS ((tree));
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index d9fa17f..b601640 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -3912,8 +3912,7 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
if (arglist2 == error_mark_node)
return error_mark_node;
- parm = copy_template_template_parm (TREE_TYPE (template), arglist2);
- TYPE_SIZE (parm) = 0;
+ parm = bind_template_template_parm (TREE_TYPE (template), arglist2);
return parm;
}
else
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 2dfc567..5ced7ef 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1112,47 +1112,33 @@ build_exception_variant (type, raises)
return v;
}
-/* Given a TEMPLATE_TEMPLATE_PARM or BOUND_TEMPLATE_TEMPLATE_PARM
- node T, create a new one together with its
- lang_specific field and its corresponding *_DECL node.
- If NEWARGS is not NULL_TREE, this parameter is bound with new set of
+/* Given a TEMPLATE_TEMPLATE_PARM node T, create a new
+ BOUND_TEMPLATE_TEMPLATE_PARM bound with NEWARGS as its template
arguments. */
tree
-copy_template_template_parm (t, newargs)
+bind_template_template_parm (t, newargs)
tree t;
tree newargs;
{
tree decl = TYPE_NAME (t);
tree t2;
- if (newargs == NULL_TREE)
- {
- t2 = make_aggr_type (TREE_CODE (t));
- decl = copy_decl (decl);
+ t2 = make_aggr_type (BOUND_TEMPLATE_TEMPLATE_PARM);
+ decl = build_decl (TYPE_DECL, DECL_NAME (decl), NULL_TREE);
- /* No need to copy these. */
- TEMPLATE_TYPE_PARM_INDEX (t2) = TEMPLATE_TYPE_PARM_INDEX (t);
- TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (t2)
- = TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (t);
- }
- else
- {
- t2 = make_aggr_type (BOUND_TEMPLATE_TEMPLATE_PARM);
- decl = build_decl (TYPE_DECL, DECL_NAME (decl), NULL_TREE);
-
- /* These nodes have to be created to reflect new TYPE_DECL and template
- arguments. */
- TEMPLATE_TYPE_PARM_INDEX (t2) = copy_node (TEMPLATE_TYPE_PARM_INDEX (t));
- TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (t2)) = decl;
- TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (t2)
- = tree_cons (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (t),
- newargs, NULL_TREE);
- }
+ /* These nodes have to be created to reflect new TYPE_DECL and template
+ arguments. */
+ TEMPLATE_TYPE_PARM_INDEX (t2) = copy_node (TEMPLATE_TYPE_PARM_INDEX (t));
+ TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (t2)) = decl;
+ TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (t2)
+ = tree_cons (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (t),
+ newargs, NULL_TREE);
TREE_TYPE (decl) = t2;
TYPE_NAME (t2) = decl;
TYPE_STUB_DECL (t2) = decl;
+ TYPE_SIZE (t2) = 0;
return t2;
}
@@ -1564,10 +1550,6 @@ copy_tree_r (tp, walk_subtrees, data)
if (TREE_CODE (*tp) == SCOPE_STMT)
SCOPE_STMT_BLOCK (*tp) = NULL_TREE;
}
- else if (code == TEMPLATE_TEMPLATE_PARM
- || code == BOUND_TEMPLATE_TEMPLATE_PARM)
- /* These must be copied specially. */
- *tp = copy_template_template_parm (*tp, NULL_TREE);
else if (TREE_CODE_CLASS (code) == 't')
/* There's no need to copy types, or anything beneath them. */
*walk_subtrees = 0;