aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-02-21 16:47:30 -0500
committerJason Merrill <jason@gcc.gnu.org>2014-02-21 16:47:30 -0500
commit3e9e24ab25fe2765881b888cc148a3a13740d4fb (patch)
tree9bb145d410b06e6106fd3c71bc5ef94c5cf9df70
parent71b735a54005a9b4bd41df990673a6310c332d58 (diff)
downloadgcc-3e9e24ab25fe2765881b888cc148a3a13740d4fb.zip
gcc-3e9e24ab25fe2765881b888cc148a3a13740d4fb.tar.gz
gcc-3e9e24ab25fe2765881b888cc148a3a13740d4fb.tar.bz2
re PR c++/60187 ([c++11] ICE with parameter pack as underlying type for enum)
PR c++/60187 * parser.c (cp_parser_enum_specifier): Call check_for_bare_parameter_packs. From-SVN: r208026
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/parser.c3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/enum_base2.C9
3 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1fcf54d..14d4995 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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++/59347
* pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
erroneous typedef.
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;