diff options
author | Jason Merrill <jason@redhat.com> | 2011-07-06 00:20:39 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-07-06 00:20:39 -0400 |
commit | 31d2ea2a9ad99d3d3c238c204fe29a4ad7c357e6 (patch) | |
tree | 016694ab6c5d728c91f5e97d931cbabfb9bad5c1 | |
parent | b935c718045e6f9b7408ffd1a049c7b297aa2235 (diff) | |
download | gcc-31d2ea2a9ad99d3d3c238c204fe29a4ad7c357e6.zip gcc-31d2ea2a9ad99d3d3c238c204fe29a4ad7c357e6.tar.gz gcc-31d2ea2a9ad99d3d3c238c204fe29a4ad7c357e6.tar.bz2 |
re PR c++/48157 (Unable to match function call to member function template)
PR c++/48157
* pt.c (tsubst_qualified_id): Preserve TEMPLATE_ID_EXPR in
partial instantiation.
From-SVN: r175904
-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 a1104b4..ed94e06 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 e7be08b..17ca44c 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 ccf0730..072bf15 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 0000000..26f4809 --- /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); +} |