+2011-01-29 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47311
+ * cp-tree.h (fixup_template_parms): Declare.
+ * pt.c (end_template_parm_list): Do not fixup template parms here.
+ (fixup_template_parms): Remove static. Fix typo in the
+ comments. Remove useless code statement.
+ (fixup_template_parm): For a template template parameter, fixup
+ its attributes before fixing up its type.
+ * parser.c
+ (cp_parser_template_declaration_after_export): After parsing
+ template parameters fixup their types.
+
2011-01-26 Jakub Jelinek <jakub@redhat.com>
PR c++/47476
static tree current_template_args (void);
static tree fixup_template_type_parm_type (tree, int);
static tree fixup_template_parm_index (tree, tree, int);
-static void fixup_template_parms (void);
static tree tsubst_template_parm (tree, tree, tsubst_flags_t);
/* Make the current scope suitable for access checking when we are
TREE_CHAIN (parm) = NULL_TREE;
}
- fixup_template_parms ();
-
--processing_template_parmlist;
return saved_parmlist;
{
/* PARM is a template template parameter. This is going to
be interesting. */
- tree tparms, targs, innermost_args;
+ tree tparms, targs, innermost_args, t;
int j;
- /* First, fix up the type of the parm. */
+ /* First, fix up the parms of the template template parm
+ because the parms are involved in defining the new canonical
+ type of the template template parm. */
- tree t =
- fixup_template_type_parm_type (TREE_TYPE (parm), num_parms);
- TREE_TYPE (parm) = t;
-
- TREE_VEC_ELT (fixedup_args, idx) =
- template_parm_to_arg (parm_desc);
-
- /* Now we need to substitute the template parm types that
- have been fixed up so far into the non-type template
- parms of this template template parm. E.g, consider this:
+ /* So we need to substitute the template parm types that have
+ been fixed up so far into the template parms of this template
+ template parm. E.g, consider this:
template<class T, template<T u> class TT> class S;
TREE_VEC_LENGTH (tparms),
targs);
}
+
+ /* Now fix up the type of the template template parm. */
+
+ t = fixup_template_type_parm_type (TREE_TYPE (parm), num_parms);
+ TREE_TYPE (parm) = t;
+
+ TREE_VEC_ELT (fixedup_args, idx) =
+ template_parm_to_arg (parm_desc);
}
else if (TREE_CODE (parm) == PARM_DECL)
{
pop_deferring_access_checks ();
}
-/* Walk current the template parms and properly compute the canonical
+/* Walk the current template parms and properly compute the canonical
types of the dependent types created during
cp_parser_template_parameter_list. */
-static void
+void
fixup_template_parms (void)
{
tree arglist;
arglist = current_template_args ();
arglist = add_outermost_template_args (arglist, fixedup_args);
- fixedup_args = INNERMOST_TEMPLATE_ARGS (arglist);
-
/* Let's do the proper fixup now. */
for (i = 0; i < num_parms; ++i)
fixup_template_parm (TREE_VEC_ELT (parameter_vec, i),