diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-06 04:20:39 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-06 04:20:39 +0000 |
commit | 2ef69b3efd587442388fd16234b3f1f13cdeebd7 (patch) | |
tree | 016694ab6c5d728c91f5e97d931cbabfb9bad5c1 | |
parent | 45c410f9119f395af5e7db3f1d71b40d571cd657 (diff) | |
download | gcc-2ef69b3efd587442388fd16234b3f1f13cdeebd7.tar.gz |
PR c++/48157
* pt.c (tsubst_qualified_id): Preserve TEMPLATE_ID_EXPR in
partial instantiation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175904 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/template-id-4.C | 22 |
4 files changed, 37 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a1104b44de9..ed94e066f44 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2011-07-05 Jason Merrill <jason@redhat.com> + PR c++/48157 + * pt.c (tsubst_qualified_id): Preserve TEMPLATE_ID_EXPR in + partial instantiation. + PR c++/49598 * semantics.c (finish_id_expression): convert_from_reference. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index e7be08bf059..17ca44cde0d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11287,8 +11287,12 @@ tsubst_qualified_id (tree qualified_id, tree args, expr = name; if (dependent_scope_p (scope)) - return build_qualified_name (NULL_TREE, scope, expr, - QUALIFIED_NAME_IS_TEMPLATE (qualified_id)); + { + if (is_template) + expr = build_min_nt (TEMPLATE_ID_EXPR, expr, template_args); + return build_qualified_name (NULL_TREE, scope, expr, + QUALIFIED_NAME_IS_TEMPLATE (qualified_id)); + } if (!BASELINK_P (name) && !DECL_P (expr)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ccf0730769b..072bf15cd10 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-07-05 Jason Merrill <jason@redhat.com> + + PR c++/48157 + * g++.dg/template/template-id-4.C: New. + 2011-07-05 Georg-Johann Lay <avr@gjlay.de> * gcc.dg/pr44023.c: Add dg-require-effective-target int32plus diff --git a/gcc/testsuite/g++.dg/template/template-id-4.C b/gcc/testsuite/g++.dg/template/template-id-4.C new file mode 100644 index 00000000000..26f4809bc96 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/template-id-4.C @@ -0,0 +1,22 @@ +// PR c++/48157 + +struct AType +{ + template<class AA> + void SomeFuncTemplate() + { } +}; + +template < class T > +struct TTest2 +{ + template<T> struct helper; + + template<class U> + static void check(helper<&U::template SomeFuncTemplate<int> > *); +}; + +int main() +{ + TTest2< void (AType::*)() >::check<AType>(0); +} |