mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
04be6ff5a8
commit
049dba029b
|
@ -1,5 +1,9 @@
|
||||||
2008-12-29 Jakub Jelinek <jakub@redhat.com>
|
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
|
PR c++/38637
|
||||||
* decl.c (start_enum): If enumtype is error_mark_node, exit early.
|
* decl.c (start_enum): If enumtype is error_mark_node, exit early.
|
||||||
|
|
||||||
|
|
|
@ -7398,7 +7398,7 @@ cp_parser_condition (cp_parser* parser)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Consume the `='. */
|
/* Consume the `='. */
|
||||||
cp_lexer_consume_token (parser->lexer);
|
cp_parser_require (parser, CPP_EQ, "%<=%>");
|
||||||
initializer = cp_parser_initializer_clause (parser, &non_constant_p);
|
initializer = cp_parser_initializer_clause (parser, &non_constant_p);
|
||||||
}
|
}
|
||||||
if (BRACE_ENCLOSED_INITIALIZER_P (initializer))
|
if (BRACE_ENCLOSED_INITIALIZER_P (initializer))
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
2008-12-29 Jakub Jelinek <jakub@redhat.com>
|
2008-12-29 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/38635
|
||||||
|
* g++.dg/parse/cond4.C: New test.
|
||||||
|
|
||||||
PR c++/36191
|
PR c++/36191
|
||||||
* g++.dg/torture/pr36191.C: New test.
|
* g++.dg/torture/pr36191.C: New test.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
// PR c++/38635
|
||||||
|
// { dg-do compile }
|
||||||
|
|
||||||
|
void foo()
|
||||||
|
{
|
||||||
|
if (struct A{}// { dg-error "types may not be defined|expected" }
|
Loading…
Reference in New Issue