Commit 049dba02 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/38635 (ICE parsing broken code)

	PR c++/38635
	* parser.c (cp_parser_condition): Use cp_parser_require
	instead of cp_lexer_consume_token to consume =.

	* g++.dg/parse/cond4.C: New test.

From-SVN: r142951
parent 04be6ff5
2008-12-29 Jakub Jelinek <jakub@redhat.com>
PR c++/38635
* parser.c (cp_parser_condition): Use cp_parser_require
instead of cp_lexer_consume_token to consume =.
PR c++/38637
* decl.c (start_enum): If enumtype is error_mark_node, exit early.
......
......@@ -7398,7 +7398,7 @@ cp_parser_condition (cp_parser* parser)
else
{
/* Consume the `='. */
cp_lexer_consume_token (parser->lexer);
cp_parser_require (parser, CPP_EQ, "%<=%>");
initializer = cp_parser_initializer_clause (parser, &non_constant_p);
}
if (BRACE_ENCLOSED_INITIALIZER_P (initializer))
......
2008-12-29 Jakub Jelinek <jakub@redhat.com>
PR c++/38635
* g++.dg/parse/cond4.C: New test.
PR c++/36191
* g++.dg/torture/pr36191.C: New test.
......
// PR c++/38635
// { dg-do compile }
void foo()
{
if (struct A{}// { dg-error "types may not be defined|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