commit 616afbea9bf859633ade63b6536e5b63be5a19e6
Author: Jason Merrill <jason@redhat.com>
Date: Mon Apr 16 09:23:41 2012 -0400
PR c++/51148
* friend.c (make_friend_class): Call check_for_bare_parameter_packs.
@@ -239,6 +239,9 @@ make_friend_class (tree type, tree friend_type, bool complain)
friend_type = cv_unqualified (friend_type);
+ if (check_for_bare_parameter_packs (friend_type))
+ return;
+
if (friend_depth)
/* If the TYPE is a template then it makes sense for it to be
friends with itself; this means that each instantiation is
new file mode 100644
@@ -0,0 +1,15 @@
+// PR c++/51148
+// { dg-do compile { target c++11 } }
+
+template<typename... Types>
+struct S
+{};
+
+template<typename... Types>
+struct T
+{
+ friend class S<Types>; // { dg-error "parameter packs not expanded" }
+};
+
+int main()
+{}