Commit b0cda57f by Paolo Carlini

re PR c++/51226 ([c++0x] ICE with opaque enum and invalid template)

/cp
2013-05-08  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51226
	* parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
	== error_mark_node.

/testsuite
2013-05-08  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51226
	* g++.dg/cpp0x/pr51226.C: New.

From-SVN: r198714
parent e61e7d28
2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51226
* parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
== error_mark_node.
2013-05-06 Marc Glisse <marc.glisse@inria.fr> 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
* typeck.c (cp_build_binary_op): Call save_expr before * typeck.c (cp_build_binary_op): Call save_expr before
......
...@@ -14856,6 +14856,8 @@ cp_parser_enum_specifier (cp_parser* parser) ...@@ -14856,6 +14856,8 @@ cp_parser_enum_specifier (cp_parser* parser)
type = NULL_TREE; type = NULL_TREE;
} }
} }
else if (nested_name_specifier == error_mark_node)
/* We already issued an error. */;
else else
error_at (type_start_token->location, error_at (type_start_token->location,
"%qD is not an enumerator-name", identifier); "%qD is not an enumerator-name", identifier);
...@@ -14965,7 +14967,8 @@ cp_parser_enum_specifier (cp_parser* parser) ...@@ -14965,7 +14967,8 @@ cp_parser_enum_specifier (cp_parser* parser)
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{ {
timevar_push (TV_PARSE_ENUM); timevar_push (TV_PARSE_ENUM);
if (nested_name_specifier) if (nested_name_specifier
&& nested_name_specifier != error_mark_node)
{ {
/* The following catches invalid code such as: /* The following catches invalid code such as:
enum class S<int>::E { A, B, C }; */ enum class S<int>::E { A, B, C }; */
......
2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51226
* g++.dg/cpp0x/pr51226.C: New.
2013-04-16 Han Shen <shenhan@google.com> 2013-04-16 Han Shen <shenhan@google.com>
Test cases for '-fstack-protector-strong'. Test cases for '-fstack-protector-strong'.
...@@ -6,7 +11,7 @@ ...@@ -6,7 +11,7 @@
2013-05-07 Ian Bolton <ian.bolton@arm.com> 2013-05-07 Ian Bolton <ian.bolton@arm.com>
* gcc.target/aarch64/ands_1.c: New test. * gcc.target/aarch64/ands_1.c: New test.
* gcc.target/aarch64/ands_2.c: Likewise * gcc.target/aarch64/ands_2.c: Likewise
2013-05-07 Christophe Lyon <christophe.lyon@linaro.org> 2013-05-07 Christophe Lyon <christophe.lyon@linaro.org>
......
// PR c++/51226
// { dg-do compile { target c++11 } }
template<int> struct A // { dg-error "provided" }
{
enum E : int;
};
template<> enum A<>::E : int {} // { dg-error "wrong number|expected" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment