From: Jason Merrill Date: Mon, 21 Apr 2008 15:59:36 +0000 (-0400) Subject: re PR c++/35678 (partial template specialization ICE in dependent_type_p, at cp/pt... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee34d21ad53623a25ce5700dadfbed5a6a025c0e;p=gcc.git re PR c++/35678 (partial template specialization ICE in dependent_type_p, at cp/pt.c:15539) PR c++/35678 * pt.c (template_template_parm_bindings_ok_p): Set processing_template_decl while in this function. From-SVN: r134515 --- 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;