aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-03-15 15:21:44 -0400
committerJason Merrill <jason@gcc.gnu.org>2016-03-15 15:21:44 -0400
commit3f91db69ca9ed5f541642146b71b2ec76043594f (patch)
tree342fc04079247cdad5e0f9e0c95f2354a3e6dc43
parent82b1c550eea601027ae7f8f80ba0bc198242d69e (diff)
downloadgcc-3f91db69ca9ed5f541642146b71b2ec76043594f.zip
gcc-3f91db69ca9ed5f541642146b71b2ec76043594f.tar.gz
gcc-3f91db69ca9ed5f541642146b71b2ec76043594f.tar.bz2
re PR c++/70141 (template parameter not deducible in partial specialization of template inside template)
PR c++/70141 * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE. From-SVN: r234228
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c5
-rw-r--r--gcc/testsuite/g++.dg/template/partial-specialization4.C26
3 files changed, 34 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 949d25d..9ace01e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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>
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 9766668..724d6e9 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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
index 0000000..1f2aced
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/partial-specialization4.C
@@ -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;