aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2000-09-05 01:01:39 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-09-04 21:01:39 -0400
commita1281f45033c96419e4a6feab46fbd1f308d26ff (patch)
tree74aa1d28311f0e2a44c3219022844b51d65b544a /gcc/cp/tree.c
parent31e0ab1f7699e3ed1bf4b47ec0701348d0dd7c2c (diff)
downloadgcc-a1281f45033c96419e4a6feab46fbd1f308d26ff.zip
gcc-a1281f45033c96419e4a6feab46fbd1f308d26ff.tar.gz
gcc-a1281f45033c96419e4a6feab46fbd1f308d26ff.tar.bz2
cp-tree.def (BOUND_TEMPLATE_TEMPLATE_PARM): New tree code.
* cp-tree.def (BOUND_TEMPLATE_TEMPLATE_PARM): New tree code. (TEMPLATE_TEMPLATE_PARM): Adjust comment. * cp-tree.h (TYPE_BINFO): Adjust comment. (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise. (TEMPLATE_TYPE_PARM_INDEX): Likewise. (IS_AGGR_TYPE): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. (TYPE_TEMPLATE_INFO): Likewise. (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): Likewise. * class.c (push_nested_class): Likewise. * decl.c (lookup_name_real): Likewise. (grokdeclarator): Likewise. (grok_op_properties): Likewise. (xref_tag): Likewise. (xref_basetypes): Likewise. * decl2.c (constructor_name_full): Likewise. (arg_assoc_template_arg): Add TEMPLATE_TEMPLATE_PARM case. (arg_assoc_type): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. * error.c (dump_type): Split TEMPLATE_TEMPLATE_PARM case. (dump_type_prefix): Add BOUND_TEMPLATE_TEMPLATE_PARM. (dump_type_suffix): Likewise. * init.c (is_aggr_type): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. (get_aggr_from_typedef): Likewise. * mangle.c (write_type): Split TEMPLATE_TEMPLATE_PARM case. (write_expression): Add BOUND_TEMPLATE_TEMPLATE_PARM. (write_template_parm): Likewise. (write_template_template_parm): Check tree code instead of using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. * method.c (build_overload_nested_name): Add BOUND_TEMPLATE_TEMPLATE_PARM. (process_overload_item): Split TEMPLATE_TEMPLATE_PARM case. * parse.y (bad_parm): Add BOUND_TEMPLATE_TEMPLATE_PARM. * pt.c (convert_template_argument): Check tree code instead of using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. (for_each_template_parm_r): Split TEMPLATE_TEMPLATE_PARM case. (for_each_template_parm): Adjust comment. (tsubst): Add BOUND_TEMPLATE_TEMPLATE_PARM. Reorganize. (tsubst_copy): Add BOUND_TEMPLATE_TEMPLATE_PARM. (unify): Add BOUND_TEMPLATE_TEMPLATE_PARM. Reorganize. Use template_args_equal to compare template template parameter cases. * ptree.c (print_lang_type): Add BOUND_TEMPLATE_TEMPLATE_PARM. * search.c (lookup_field_1): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. * tree.c (copy_template_template_parm): Decide whether to create a TEMPLATE_TEMPLATE_PARM or BOUND_TEMPLATE_TEMPLATE_PARM node. (walk_tree): Add BOUND_TEMPLATE_TEMPLATE_PARM. (copy_tree_r): Likewise. * typeck.c (comptypes): Likewise. Check tree code instead of using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. From-SVN: r36149
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 371f00f..be2459a 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1176,7 +1176,8 @@ build_exception_variant (type, raises)
return v;
}
-/* Given a TEMPLATE_TEMPLATE_PARM node T, create a new one together with its
+/* 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
arguments. */
@@ -1189,9 +1190,9 @@ copy_template_template_parm (t, newargs)
tree decl = TYPE_NAME (t);
tree t2;
- t2 = make_aggr_type (TEMPLATE_TEMPLATE_PARM);
if (newargs == NULL_TREE)
{
+ t2 = make_aggr_type (TREE_CODE (t));
decl = copy_decl (decl);
/* No need to copy these. */
@@ -1201,6 +1202,7 @@ copy_template_template_parm (t, newargs)
}
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
@@ -1329,6 +1331,7 @@ walk_tree (tp, func, data)
case STRING_CST:
case DEFAULT_ARG:
case TEMPLATE_TEMPLATE_PARM:
+ case BOUND_TEMPLATE_TEMPLATE_PARM:
case TEMPLATE_PARM_INDEX:
case TEMPLATE_TYPE_PARM:
case REAL_TYPE:
@@ -1581,7 +1584,8 @@ 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)
+ 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')