]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/60187 ([c++11] ICE with parameter pack as underlying type for enum)
authorJason Merrill <jason@redhat.com>
Fri, 21 Feb 2014 22:15:01 +0000 (17:15 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 21 Feb 2014 22:15:01 +0000 (17:15 -0500)
PR c++/60187
* parser.c (cp_parser_enum_specifier): Call
check_for_bare_parameter_packs.

From-SVN: r208031

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

index 51bb21df70281d69c3da8ba15cb834907e908f3c..f8c79a60d2e2b16c230f2b671e385137d1449c16 100644 (file)
@@ -1,5 +1,9 @@
 2014-02-21  Jason Merrill  <jason@redhat.com>
 
+       PR c++/60187
+       * parser.c (cp_parser_enum_specifier): Call
+       check_for_bare_parameter_packs.
+
        PR c++/60216
        * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
 
index b0a7abefce14481b68164d016c7e7a8dbe9dbc55..de30f7325b7128fdeb9767ef1918f72f2ac3e77a 100644 (file)
@@ -14738,7 +14738,8 @@ cp_parser_enum_specifier (cp_parser* parser)
         {
           underlying_type = grokdeclarator (NULL, &type_specifiers, TYPENAME,
                                             /*initialized=*/0, NULL);
-          if (underlying_type == error_mark_node)
+          if (underlying_type == error_mark_node
+             || check_for_bare_parameter_packs (underlying_type))
             underlying_type = NULL_TREE;
         }
     }
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum_base2.C b/gcc/testsuite/g++.dg/cpp0x/enum_base2.C
new file mode 100644 (file)
index 0000000..8c6a901
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/60187
+// { dg-require-effective-target c++11 }
+
+template<typename... T> struct A
+{
+  enum E : T {};               // { dg-error "parameter pack" }
+};
+
+A<int> a;