* parser.c (cp_parser_statement): If the parser reached CPP_EOF,
only complain about missing statement.
* g++.dg/parse/for1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105520
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-10-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/23440
+ * parser.c (cp_parser_statement): If the parser reached CPP_EOF,
+ only complain about missing statement.
+
2005-10-17 Nathan Sidwell <nathan@codesourcery.com>
PR c++/24386
cp_lexer_handle_pragma (parser->lexer);
return;
}
+ else if (token->type == CPP_EOF)
+ {
+ cp_parser_error (parser, "expected statement");
+ return;
+ }
/* Everything else must be a declaration-statement or an
expression-statement. Try for the declaration-statement
+2005-10-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/23440
+ * g++.dg/parse/for1.C: New test.
+
2005-10-17 Paul Thomas <pault@gcc.gnu.org>
PR fortran/23446
--- /dev/null
+// PR c++/23440
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// { dg-do compile }
+// { dg-options "" }
+
+# 0 "for1.C"
+void foo() { for (;;) // { dg-error "at end of input" "" { target *-*-* } 0 }