summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-15 16:52:25 +0000
committerreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-15 16:52:25 +0000
commitd038ab63d220d8c3033d0d1da436b1abcf8dc3f7 (patch)
tree3becacfcfd14124e3f5ae691909077bb166e199d
parent5c19cce4d522acb7ee5dfeaae7c517d25666bdb6 (diff)
downloadgcc-d038ab63d220d8c3033d0d1da436b1abcf8dc3f7.tar.gz
PR c/28649
* c-parser.c (c_parser_compound_statement_nostart): Reset parser->error after each statement. * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116157 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-parser.c2
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/gcc.dg/cpp/digraph2.c2
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/920923-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/parse-error-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/parse-error-2.c14
7 files changed, 42 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 033b64bfa24..a4a21322932 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 f895d423b31..848da6305dc 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 5f141952f1d..d88769987e8 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 16fcbaebe07..293cafa496d 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 8011f28cbb4..8dd19b272f9 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 00000000000..704786f4f13
--- /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 00000000000..7ab3cd7c056
--- /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" } */
+}