https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71883
--- Comment #5 from kargl at gcc dot gnu.org --- (In reply to Thomas Koenig from comment #4) > The problem here is that we want to do some dependency > checking on something that is invalid. > > Maybe the best way would be to skip the whole pass if a > previous fatal error was diagnosed. > > Is there a way to check for this? You can check the error count. If it is greater than 0, you have an error. Here's an example from my private tree --- expr.c (revision 237945) +++ expr.c (working copy) @@ -970,8 +970,14 @@ gfc_is_constant_expr (gfc_expr *e) default: - gfc_internal_error ("gfc_is_constant_expr(): Unknown expression type"); - return 0; + { + int e, w; + gfc_get_errors (&w, &e); + if (e < 1) + gfc_internal_error ("gfc_is_constant_expr(): Unknown " + "expression type"); + return 0; + } } }