]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/70141
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Mar 2016 19:21:44 +0000 (19:21 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Mar 2016 19:21:44 +0000 (19:21 +0000)
* pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234228 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 949d25da2477b7c47584546483d61640e3b98390..9ace01eddbaa51a06e574baa090ae65cab733601 100644 (file)
@@ -1,3 +1,8 @@
+2016-03-15  Jason Merrill  <jason@redhat.com>
+
+       PR c++/70141
+       * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
+
 2016-03-14  Casey Carter  <casey@carter.net>
            Jason Merrill  <jason@redhat.com>
 
index 9766668dfcf5c95c5caea7b927a253a9d1f8fc5a..724d6e9944135c33ca1af0613c05e14de6eb2cd0 100644 (file)
@@ -8851,8 +8851,9 @@ for_each_template_parm_r (tree *tp, int *walk_subtrees, void *d)
       break;
 
     case TYPENAME_TYPE:
-      if (!fn)
-       WALK_SUBTREE (TYPENAME_TYPE_FULLNAME (t));
+      /* A template-id in a TYPENAME_TYPE might be a deduced context after
+        partial instantiation.  */
+      WALK_SUBTREE (TYPENAME_TYPE_FULLNAME (t));
       break;
 
     case CONSTRUCTOR:
diff --git a/gcc/testsuite/g++.dg/template/partial-specialization4.C b/gcc/testsuite/g++.dg/template/partial-specialization4.C
new file mode 100644 (file)
index 0000000..1f2aced
--- /dev/null
@@ -0,0 +1,26 @@
+// PR c++/70141
+
+template <typename T>
+struct outer
+{
+  template <typename U>
+  struct inner
+  {
+
+  };
+};
+
+
+template <typename T>
+struct is_inner_for
+{
+  template <typename Whatever>
+  struct predicate;
+
+  template <typename U>
+  struct predicate<typename outer<T>::template inner<U> >
+  {
+  };
+};
+
+is_inner_for<int>::predicate<outer<int>::inner<double> > p;