This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH for c++/60187 (ICE with bare parameter pack in enum-base)
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 21 Feb 2014 16:47:14 -0500
- Subject: C++ PATCH for c++/60187 (ICE with bare parameter pack in enum-base)
- Authentication-results: sourceware.org; auth=none
Yet another place where we need to check for bare parameter packs.
Tested x86_64-pc-linux-gnu, applying to trunk and 4.8.
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;