From a51b785a0fa0758b54dbca34f499f4f11da2ad23 Mon Sep 17 00:00:00 2001 From: jason Date: Mon, 9 Aug 2010 21:13:12 +0000 Subject: [PATCH] PR c++/45236 * pt.c (lookup_template_class): Don't re-coerce outer parms. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163042 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 15 ++++++++++----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/variadic-104.C | 16 ++++++++++++++++ 4 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/variadic-104.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6355215..c202af4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2010-08-09 Jason Merrill + + PR c++/45236 + * pt.c (lookup_template_class): Don't re-coerce outer parms. + 2010-08-09 Nathan Froyd * call.c (add_builtin_candidates): Use VECs for local variable diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index bb6b1a0..02c54f9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -6540,11 +6540,16 @@ lookup_template_class (tree d1, i > 0 && t != NULL_TREE; --i, t = TREE_CHAIN (t)) { - tree a = coerce_template_parms (TREE_VALUE (t), - arglist, gen_tmpl, - complain, - /*require_all_args=*/true, - /*use_default_args=*/true); + tree a; + if (i == saved_depth) + a = coerce_template_parms (TREE_VALUE (t), + arglist, gen_tmpl, + complain, + /*require_all_args=*/true, + /*use_default_args=*/true); + else + /* Outer levels should have already been coerced. */ + a = TMPL_ARGS_LEVEL (arglist, i); /* Don't process further if one of the levels fails. */ if (a == error_mark_node) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 638f3af..8e73a3b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-08-09 Jason Merrill + + PR c++/45236 + * g++.dg/cpp0x/variadic-104.C: New. + 2010-08-09 Thomas Koenig PR fortran/44235 diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-104.C b/gcc/testsuite/g++.dg/cpp0x/variadic-104.C new file mode 100644 index 0000000..c693b33 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-104.C @@ -0,0 +1,16 @@ +// PR c++/45236 +// { dg-options -std=c++0x } + +template class foo; + +template class C, int... II, class S> +struct foo,S> +{ + template + struct bar { typedef int type; }; +}; + +template +struct A {}; + +foo, float>::bar x; -- 2.7.4