From 3f91db69ca9ed5f541642146b71b2ec76043594f Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 15 Mar 2016 15:21:44 -0400 Subject: 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 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 5 +++-- .../g++.dg/template/partial-specialization4.C | 26 ++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/template/partial-specialization4.C (limited to 'gcc') 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 + + PR c++/70141 + * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE. + 2016-03-14 Casey Carter Jason Merrill 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 +struct outer +{ + template + struct inner + { + + }; +}; + + +template +struct is_inner_for +{ + template + struct predicate; + + template + struct predicate::template inner > + { + }; +}; + +is_inner_for::predicate::inner > p; -- cgit v1.1