commit 50ab88c80a398570a84f65802c3e004e46f27eeb
Author: Jason Merrill <jason@redhat.com>
Date: Tue Jul 5 21:54:43 2011 -0400
PR c++/48157
* pt.c (tsubst_qualified_id): Preserve TEMPLATE_ID_EXPR in
partial instantiation.
@@ -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))
{
new file mode 100644
@@ -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);
+}