PR c++/51148
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Apr 2012 14:15:36 +0000 (14:15 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Apr 2012 14:15:36 +0000 (14:15 +0000)
* friend.c (make_friend_class): Call check_for_bare_parameter_packs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186495 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/friend.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/variadic127.C [new file with mode: 0644]

index c511a12..5a3d337 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/51148
+       * friend.c (make_friend_class): Call check_for_bare_parameter_packs.
+
 2012-04-16  Jan Hubicka  <jh@suse.cz>
 
        * decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
index e532a30..87a093a 100644 (file)
@@ -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
index 847f90e..27df0fb 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/51148
+       * g++.dg/cpp0x/variadic127.C: New.
+
 2012-04-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * lib/plugin-support.exp (plugin-test-execute): Properly determine
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic127.C b/gcc/testsuite/g++.dg/cpp0x/variadic127.C
new file mode 100644 (file)
index 0000000..2e0d593
--- /dev/null
@@ -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()
+{}