diff options
author | Steve Kargl <kargl@gcc.gnu.org> | 2022-11-22 22:31:51 +0100 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2022-11-23 19:10:42 +0100 |
commit | 2eaa0cc45e8eae0fc4a440d28c602964bcb1014d (patch) | |
tree | 353f712bcfcf57c6e103c63a3a060d60553a9fea /gcc/fortran/resolve.cc | |
parent | 8a0fce6a51915c29584427fd376b40073c328090 (diff) | |
download | gcc-2eaa0cc45e8eae0fc4a440d28c602964bcb1014d.zip gcc-2eaa0cc45e8eae0fc4a440d28c602964bcb1014d.tar.gz gcc-2eaa0cc45e8eae0fc4a440d28c602964bcb1014d.tar.bz2 |
Fortran: error recovery on associate with bad selector [PR107577]
gcc/fortran/ChangeLog:
PR fortran/107577
* resolve.cc (find_array_spec): Choose appropriate locus either of
bad array reference or of non-array entity in error message.
gcc/testsuite/ChangeLog:
PR fortran/107577
* gfortran.dg/pr107577.f90: New test.
Diffstat (limited to 'gcc/fortran/resolve.cc')
-rw-r--r-- | gcc/fortran/resolve.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc index 24e5aa0..3396c6c 100644 --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolve.cc @@ -5005,8 +5005,9 @@ find_array_spec (gfc_expr *e) case REF_ARRAY: if (as == NULL) { + locus loc = ref->u.ar.where.lb ? ref->u.ar.where : e->where; gfc_error ("Invalid array reference of a non-array entity at %L", - &ref->u.ar.where); + &loc); return false; } |