diff mbox

C++ PATCH for c++/60187 (ICE with bare parameter pack in enum-base)

Message ID 5307C962.5040804@redhat.com
State New
Headers show

Commit Message

Jason Merrill Feb. 21, 2014, 9:47 p.m. UTC
Yet another place where we need to check for bare parameter packs.

Tested x86_64-pc-linux-gnu, applying to trunk and 4.8.
diff mbox

Patch

commit 4e02d1498063b3ffa31d3fe35682b0c94667360c
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Feb 21 14:03:36 2014 -0500

    	PR c++/60187
    	* parser.c (cp_parser_enum_specifier): Call
    	check_for_bare_parameter_packs.

diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 6f19ae2..7bbdf90 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -15376,7 +15376,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
index 0000000..8c6a901
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/enum_base2.C
@@ -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;