aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>2000-06-23 06:49:45 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-06-23 02:49:45 -0400
commit1899c3a49ed1f0516e56c41070951c9e0e4d9e4f (patch)
tree1031c3579a6b908c1508fb505a7aab1f459c9611 /gcc/cp/pt.c
parent691125710d580d96e6c94f04fe0e1205507ee899 (diff)
downloadgcc-1899c3a49ed1f0516e56c41070951c9e0e4d9e4f.zip
gcc-1899c3a49ed1f0516e56c41070951c9e0e4d9e4f.tar.gz
gcc-1899c3a49ed1f0516e56c41070951c9e0e4d9e4f.tar.bz2
parse.y (template_arg): Convert TEMPLATE_DECL that is a template template paramter to...
* parse.y (template_arg): Convert TEMPLATE_DECL that is a template template paramter to TEMPLATE_TEMPLATE_PARM here. * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Adjust comment. * cp-tree.h (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): New macro. (copy_template_template_parm): Adjust prototype. * decl.c (grokdeclarator): Remove dead code. * pt.c (process_template_parm): Tidy. (lookup_template_class): Construct nodes in copy_template_template_parm. (tsubst): Pass TEMPLATE_DECL rather than IDENTIFIER_NODE to lookup_template_class. Use TYPE_TI_TEMPLATE. * tree.c (copy_template_template_parm): Add NEWARGS parameter. (mapcar): Adjust call to copy_template_template_parm. * typeck.c (comptypes): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL. * method.c (build_template_template_parm_names): Change error code to avoid compilation warning. * gxxint.texi: Document template template parameter name mangling. From-SVN: r34659
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index af0c7c4..8da3dd5 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1797,10 +1797,8 @@ process_template_parm (list, next)
{
tree p = TREE_VALUE (tree_last (list));
- if (TREE_CODE (p) == TYPE_DECL)
+ if (TREE_CODE (p) == TYPE_DECL || TREE_CODE (p) == TEMPLATE_DECL)
idx = TEMPLATE_TYPE_IDX (TREE_TYPE (p));
- else if (TREE_CODE (p) == TEMPLATE_DECL)
- idx = TEMPLATE_TYPE_IDX (TREE_TYPE (DECL_TEMPLATE_RESULT (p)));
else
idx = TEMPLATE_PARM_IDX (DECL_INITIAL (p));
++idx;
@@ -3803,8 +3801,7 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope)
/* Create a new TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM node to store
template arguments */
- tree parm = copy_template_template_parm (TREE_TYPE (template));
- tree template2 = TYPE_STUB_DECL (parm);
+ tree parm;
tree arglist2;
parmlist = DECL_INNERMOST_TEMPLATE_PARMS (template);
@@ -3813,8 +3810,7 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope)
if (arglist2 == error_mark_node)
return error_mark_node;
- TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (parm)
- = tree_cons (template2, arglist2, NULL_TREE);
+ parm = copy_template_template_parm (TREE_TYPE (template), arglist2);
TYPE_SIZE (parm) = 0;
return parm;
}
@@ -6333,7 +6329,7 @@ tsubst (t, args, complain, in_decl)
if (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
arg = TYPE_NAME (arg);
- r = lookup_template_class (DECL_NAME (arg),
+ r = lookup_template_class (arg,
argvec, in_decl,
DECL_CONTEXT (arg),
/*entering_scope=*/0);
@@ -6383,7 +6379,7 @@ tsubst (t, args, complain, in_decl)
return error_mark_node;
TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (r)
- = tree_cons (TYPE_NAME (t), argvec, NULL_TREE);
+ = tree_cons (TYPE_TI_TEMPLATE (t), argvec, NULL_TREE);
}
break;