Blame SOURCES/gcc8-pr86747.patch

745403
2018-12-06  Alexandre Oliva <aoliva@redhat.com>
745403
 
745403
	PR c++/86747
745403
	* pt.c (tsubst_friend_class): Enter tsubsted class context.
745403
745403
--- gcc/cp/pt.c
745403
+++ gcc/cp/pt.c
745403
@@ -10558,7 +10558,10 @@ tsubst_friend_class (tree friend_tmpl, tree args)
745403
   if (TREE_CODE (context) == NAMESPACE_DECL)
745403
     push_nested_namespace (context);
745403
   else
745403
-    push_nested_class (context);
745403
+    {
745403
+      context = tsubst (context, args, tf_error, NULL_TREE);
745403
+      push_nested_class (context);
745403
+    }
745403
 
745403
   tmpl = lookup_name_real (DECL_NAME (friend_tmpl), /*prefer_type=*/false,
745403
 			   /*non_class=*/false, /*block_p=*/false,
745403
--- /dev/null
745403
+++ gcc/testsuite/g++.dg/pr86747.C
745403
@@ -0,0 +1,8 @@
745403
+// { dg-do compile }
745403
+
745403
+template <typename T> class A {
745403
+  template <void (A::*p)()> class C; // #1
745403
+  template <void (A::*q)()> friend class C; // #2
745403
+};
745403
+
745403
+A<double> a;