+2019-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91715
+ * decl.c (gfc_match_prefix): If matching a type-spec returns an error,
+ it's an error so re-act correctly.
+
2019-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/92018
found_prefix = true;
}
- if (!seen_type && ts != NULL
- && gfc_match_decl_type_spec (ts, 0) == MATCH_YES
- && gfc_match_space () == MATCH_YES)
+ if (!seen_type && ts != NULL)
{
-
- seen_type = true;
- found_prefix = true;
+ match m;
+ m = gfc_match_decl_type_spec (ts, 0);
+ if (m == MATCH_ERROR)
+ goto error;
+ if (m == MATCH_YES && gfc_match_space () == MATCH_YES)
+ {
+ seen_type = true;
+ found_prefix = true;
+ }
}
if (gfc_match ("elemental% ") == MATCH_YES)
+2019-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91715
+ * gfortran.dg/function_kinds_5.f90: Prune run-on error.
+ * gfortran.dg/pr85543.f90: Ditto.
+ * gfortran.dg/pr91715.f90: New test.
+
2019-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/92018
real (bad_kind(0d0)) function foo () ! { dg-error "must be an intrinsic function" }
foo = real (kind (foo))
end function
+! { dg-prune-output "Bad kind expression for function" }
real(z()) function f() ! { dg-error "in initialization expression at" }
end
end
+! { dg-prune-output "Bad kind expression for function" }
--- /dev/null
+! { dg-do compile }
+! PR fortran/91715
+! Code contributed Gerhard Steinmetz
+character(1function f() ! { dg-error "Syntax error in CHARACTER" }
+end