re PR c++/35678 (partial template specialization ICE in dependent_type_p, at cp/pt...
authorJason Merrill <jason@redhat.com>
Mon, 21 Apr 2008 15:59:36 +0000 (11:59 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 21 Apr 2008 15:59:36 +0000 (11:59 -0400)
        PR c++/35678
        * pt.c (template_template_parm_bindings_ok_p): Set
        processing_template_decl while in this function.

From-SVN: r134515

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/ttp27.C [new file with mode: 0644]

index b348c0d13490bfac2bb0eceb448d74f150b2c67e..09b2e08f0a5fa40585891343372dc61a0ea95d8f 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-21  Jason Merrill  <jason@redhat.com>
+
+       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 <kris.van.hees@oracle.com>
 
        * cvt.c (type_promotes_to): Support char16_t and char32_t.
index 40662d9166867d299fc791671294f6f80bf90e01..e55ce97b6a700a78d21b3cec98f364dc38694f40 100644 (file)
@@ -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
index 02e190f23b078509122864c75424c7c810aec046..dca56d962bba68eab00e14a6e7288902d1f79f98 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-21  Jason Merrill  <jason@redhat.com>
+
+       PR c++/35678
+       * g++.dg/template/ttp27.C: New.
+
 2008-04-21  Tom Tromey  <tromey@redhat.com>
 
        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 (file)
index 0000000..f693690
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/35678
+
+template<typename T, T> struct A;
+template<typename> struct B; 
+template<template<typename T, T> class U> struct B<U<char, 'h'> > {};
+B<A<char,'h'> > x;