2019-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77960
* io.c (match_io_element): input-item cannot be an external function.
2019-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77960
* gfortran.dg/pr77960.f90: New test.
From-SVN: r268097
+2019-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/77960
+ * io.c (match_io_element): input-item cannot be an external function.
+
2018-01-19 Thomas Koenig <tkoenig@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
m = gfc_match_variable (&expr, 0);
if (m == MATCH_NO)
gfc_error ("Expected variable in READ statement at %C");
+
+ if (m == MATCH_YES
+ && expr->expr_type == EXPR_VARIABLE
+ && expr->symtree->n.sym->attr.external)
+ {
+ gfc_error ("Expecting variable or io-implied-do at %L",
+ &expr->where);
+ m = MATCH_ERROR;
+ }
+
}
else
{
+2019-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/77960
+ * gfortran.dg/pr77960.f90: New test.
+
2018-01-19 Thomas Koenig <tkoenig@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
--- /dev/null
+! { dg-do compile }
+! PR fortran/77960
+ procedure(g), pointer :: f
+ f => g
+ read(99) f ! { dg-error "Expecting variable" }
+contains
+ function g() result(z)
+ integer :: z(2)
+ z = 1
+ end
+end
+
+subroutine bar(x)
+ integer, external :: x
+ read(*,*) x ! { dg-error "Expecting variable" }
+end subroutine