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
This commit is contained in:
Jason Merrill 2014-02-21 16:47:30 -05:00 committed by Jason Merrill
parent 71b735a540
commit 3e9e24ab25
3 changed files with 15 additions and 1 deletions

View 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++/59347
* pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
erroneous typedef.

View file

@ -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;
}
}

View file

@ -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;