aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 399867b..6b33c57 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -587,10 +587,16 @@ decode_statement (void)
}
/* All else has failed, so give up. See if any of the matchers has
- stored an error message of some sort. */
-
+ stored an error message of some sort. Suppress the "Unclassifiable
+ statement" if a previous error message was emitted, e.g., by
+ gfc_error_now (). */
if (!gfc_error_check ())
- gfc_error_now ("Unclassifiable statement at %C");
+ {
+ int ecnt;
+ gfc_get_errors (NULL, &ecnt);
+ if (ecnt <= 0)
+ gfc_error_now ("Unclassifiable statement at %C");
+ }
reject_statement ();