From: Douglas Gregor Date: Wed, 26 Mar 2008 04:17:57 +0000 (+0000) Subject: pt.c (coerce_template_template_parm): Moved the body of the loop of coerce_template_t... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0a5f30f8e6741d55daca7fb3093df6365425661;p=gcc.git pt.c (coerce_template_template_parm): Moved the body of the loop of coerce_template_template_parms here... 2008-03-26 Douglas Gregor * pt.c (coerce_template_template_parm): Moved the body of the loop of coerce_template_template_parms here, to make iteration over a template argument pack simpler. Also, allow matching of a template parameter pack in the template template parameter to a template parameter in the template template argument. (coerce_template_template_parms): Deal with variadic template template parameters. Use coerce_template_template_parm. (unify): Make sure we coerce the template template argument's template arguments to the template template parameter's template parameters, not the other way around. 2008-03-26 Douglas Gregor * g++.dg/cpp0x/variadic84.C: Update to reflect the change in variadic template template parameter binding semantics. * g++.dg/cpp0x/variadic85.C: Ditto. * g++.dg/cpp0x/variadic88.C: New. * g++.dg/cpp0x/variadic89.C: New. * g++.dg/cpp0x/variadic90.C: New. * g++.dg/cpp0x/variadic-ex14.C: Update to reflect the change in variadic template template parameter binding semantics. * g++.dg/cpp0x/variadic-lambda.C: New. From-SVN: r133543 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5ddc8b555b7..87e8c05ef1d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2008-03-26 Douglas Gregor + + * pt.c (coerce_template_template_parm): Moved the body of the loop + of coerce_template_template_parms here, to make iteration over a + template argument pack simpler. + Also, allow matching of a template parameter pack in the template + template parameter to a template parameter in the template + template argument. + (coerce_template_template_parms): Deal with variadic template + template parameters. Use coerce_template_template_parm. + (unify): Make sure we coerce the template template argument's + template arguments to the template template parameter's template + parameters, not the other way around. + 2008-03-25 Tom Tromey * Make-lang.in: Remove .o targets. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index bc33efc7fbd..67d392da456 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4630,6 +4630,77 @@ convert_nontype_argument (tree type, tree expr) return expr; } +/* Subroutine of coerce_template_template_parms, which returns 1 if + PARM_PARM and ARG_PARM match using the rule for the template + parameters of template template parameters. Both PARM and ARG are + template parameters; the rest of the arguments are the same as for + coerce_template_template_parms. + */ +static int +coerce_template_template_parm (tree parm, + tree arg, + tsubst_flags_t complain, + tree in_decl, + tree outer_args) +{ + if (arg == NULL_TREE || arg == error_mark_node + || parm == NULL_TREE || parm == error_mark_node) + return 0; + + if (TREE_CODE (arg) != TREE_CODE (parm)) + return 0; + + switch (TREE_CODE (parm)) + { + case TEMPLATE_DECL: + /* We encounter instantiations of templates like + template