+2020-01-19 Thomas König <tkoenig@gcc.gnu.org>
+
+ PR fortran/44960
+ * primary.c (gfc_match_rvalue): Break after setting MATCH_ERROR.
+ * resolve.c (resolve_function): Issue error when a
+ function call contains a reference.
+
2020-01-17 Mark Eggleston <mark.eggleston@codethink.com>
PR fortran/93236
gfc_error ("The leftmost part-ref in a data-ref cannot be a "
"function reference at %C");
m = MATCH_ERROR;
+ break;
}
m = MATCH_YES;
|| sym->intmod_sym_id == GFC_ISYM_CAF_SEND))
return true;
+ if (expr->ref)
+ {
+ gfc_error ("Unexpected junk after %qs at %L", expr->symtree->n.sym->name,
+ &expr->where);
+ return false;
+ }
+
if (sym && sym->attr.intrinsic
&& !gfc_resolve_intrinsic (sym, &expr->where))
return false;
+2020-01-19 Thomas König <tkoenig@gcc.gnu.org>
+
+ PR fortran/44960
+ * gfortran.dg/function_reference_1.f90: New test.
+ * gfortran.dg/function_reference_2.f90: New test.
+
2020-01-18 Jakub Jelinek <jakub@redhat.com>
PR c/92833
--- /dev/null
+! { dg-do compile }
+! PR 44960 - this was erroneusly accepted.
+! Original test case by Daniel Franke.
+
+type t
+ integer :: a
+end type t
+type(t) :: foo
+print *, foo(1)%a ! { dg-error "Unexpected junk" }
+end
+
--- /dev/null
+! { dg-do compile }
+! PR 44960 - improve the error message
+program main
+ type t
+ integer :: a
+end type t
+type(t) :: foo
+external foo
+i = foo(1)%1 ! { dg-error "leftmost part-ref in a data-ref cannot be a function reference" }
+end