diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b348c0d1349..09b2e08f0a5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-04-21 Jason Merrill + + PR c++/35678 + * pt.c (template_template_parm_bindings_ok_p): Set + processing_template_decl while in this function. + 2008-04-18 Kris Van Hees * cvt.c (type_promotes_to): Support char16_t and char32_t. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 40662d91668..e55ce97b6a7 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4814,6 +4814,10 @@ bool template_template_parm_bindings_ok_p (tree tparms, tree targs) { int i, ntparms = TREE_VEC_LENGTH (tparms); + bool ret = true; + + /* We're dealing with template parms in this process. */ + ++processing_template_decl; targs = INNERMOST_TEMPLATE_ARGS (targs); @@ -4864,13 +4868,18 @@ template_template_parm_bindings_ok_p (tree tparms, tree targs) tf_none, tparm, targs)) - return false; + { + ret = false; + goto out; + } } } } - /* Everything is okay. */ - return true; + out: + + --processing_template_decl; + return ret; } /* Convert the indicated template ARG as necessary to match the diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 02e190f23b0..dca56d962bb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-04-21 Jason Merrill + + PR c++/35678 + * g++.dg/template/ttp27.C: New. + 2008-04-21 Tom Tromey PR libcpp/33415: diff --git a/gcc/testsuite/g++.dg/template/ttp27.C b/gcc/testsuite/g++.dg/template/ttp27.C new file mode 100644 index 00000000000..f693690852b --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ttp27.C @@ -0,0 +1,6 @@ +// PR c++/35678 + +template struct A; +template struct B; +template class U> struct B > {}; +B > x;