aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2016-09-30 23:19:58 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2016-09-30 23:19:58 +0000
commite3228a50387ff82d51f2edc37bc12e91fa21a25f (patch)
treeed4f5abca9436ae6c46615fc7fdb47ec85d7fa1e /gcc/fortran/io.c
parent5afa955f12d5be0c748e999f18fa5f57881115b8 (diff)
downloadgcc-e3228a50387ff82d51f2edc37bc12e91fa21a25f.zip
gcc-e3228a50387ff82d51f2edc37bc12e91fa21a25f.tar.gz
gcc-e3228a50387ff82d51f2edc37bc12e91fa21a25f.tar.bz2
re PR fortran/66643 (Missing compilation error for formatted data transfer without format)
2016-09-30 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/66643 * io.c (match_dt_unit): Peek check for missing format. * gfortran.fortran-torture/compile/arrayio.f90: Update test. * gfortran.fortran-torture/compile/write.f90: Update test. From-SVN: r240686
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 48c15ef..7c48c49 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -2688,6 +2688,7 @@ static match
match_dt_unit (io_kind k, gfc_dt *dt)
{
gfc_expr *e;
+ char c;
if (gfc_match_char ('*') == MATCH_YES)
{
@@ -2695,6 +2696,11 @@ match_dt_unit (io_kind k, gfc_dt *dt)
goto conflict;
dt->io_unit = default_unit (k);
+
+ c = gfc_peek_ascii_char ();
+ if (c == ')')
+ gfc_error_now ("Missing format with default unit at %C");
+
return MATCH_YES;
}