diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-parser.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/digraph2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/noncompile/920923-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/parse-error-1.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/parse-error-2.c | 14 |
7 files changed, 42 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 033b64b..a4a2132 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-08-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + + PR c/28649 + * c-parser.c (c_parser_compound_statement_nostart): Reset + parser->error after each statement. + 2006-08-15 Jakub Jelinek <jakub@redhat.com> PR middle-end/28713 diff --git a/gcc/c-parser.c b/gcc/c-parser.c index f895d42..848da63 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -3486,6 +3486,8 @@ c_parser_compound_statement_nostart (c_parser *parser) last_stmt = true; c_parser_statement_after_labels (parser); } + + parser->error = false; } if (last_label) error ("label at end of compound statement"); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5f14195..d887699 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2006-08-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + + PR c/28649 + * gcc.dg/parse-error-1.c: New test. + * gcc.dg/parse-error-2.c: New test. + * gcc.dg/cpp/digraph2.c: Add error-marker. + * gcc.dg/noncompile/920923-1.c: Likewise. + 2006-08-14 Andrew Pinski <pinskia@physics.uc.edu> PR c/27490 diff --git a/gcc/testsuite/gcc.dg/cpp/digraph2.c b/gcc/testsuite/gcc.dg/cpp/digraph2.c index 16fcbae..293cafa 100644 --- a/gcc/testsuite/gcc.dg/cpp/digraph2.c +++ b/gcc/testsuite/gcc.dg/cpp/digraph2.c @@ -13,7 +13,7 @@ int main (int argc, char *argv[]) /* Place this after main () so we get to test both the compiler above and the preprocessor below. */ -%:define glue +%:define glue /* { dg-error "expected declaration" } */ #ifdef glue #error glue is defined! #endif diff --git a/gcc/testsuite/gcc.dg/noncompile/920923-1.c b/gcc/testsuite/gcc.dg/noncompile/920923-1.c index 8011f28..8dd19b2 100644 --- a/gcc/testsuite/gcc.dg/noncompile/920923-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/920923-1.c @@ -56,7 +56,7 @@ caddr_t v_addr; /* { dg-error "expected" } */ { register prec_t bucket; register caddr_t p_addr; /* { dg-error "expected|undeclared" } */ - bucket = mem_hash+((((v_addr)>>ITEMBITS))&hash_mask); + bucket = mem_hash+((((v_addr)>>ITEMBITS))&hash_mask); /* { dg-error "undeclared" } */ do { if (bucket->v_addr == ((v_addr)>>ITEMBITS) { /* { dg-error "expected|undeclared|no member" } */ if(!(bucket->perm_set&va_op)) diff --git a/gcc/testsuite/gcc.dg/parse-error-1.c b/gcc/testsuite/gcc.dg/parse-error-1.c new file mode 100644 index 0000000..704786f --- /dev/null +++ b/gcc/testsuite/gcc.dg/parse-error-1.c @@ -0,0 +1,10 @@ +/* PR c/28649 */ +/* { dg-do compile } */ + +void foo() +{ + +; /* { dg-error "expected expression" } */ + +; /* { dg-error "expected expression" } */ +} + +int +; /* { dg-error "expected identifier" } */ diff --git a/gcc/testsuite/gcc.dg/parse-error-2.c b/gcc/testsuite/gcc.dg/parse-error-2.c new file mode 100644 index 0000000..7ab3cd7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/parse-error-2.c @@ -0,0 +1,14 @@ +/* PR c/28649 */ +/* { dg-do compile } */ + +void foo() +{ + +; /* { dg-error "expected expression" } */ +} + +int i; + +void bar() +{ + i++; /* { dg-bogus "undeclared" } */ +} |