diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2020-07-05 20:11:35 +0200 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2020-07-05 20:13:41 +0200 |
commit | cc9a9229285a26ac12bc8de53237ce9c4d42f867 (patch) | |
tree | 3cf1f57ca03637bc33a220fd8d032db66beaafad /gcc/fortran/resolve.c | |
parent | 706e6f613d23b708f44e7874b1f64ddbe155faf1 (diff) | |
download | gcc-cc9a9229285a26ac12bc8de53237ce9c4d42f867.zip gcc-cc9a9229285a26ac12bc8de53237ce9c4d42f867.tar.gz gcc-cc9a9229285a26ac12bc8de53237ce9c4d42f867.tar.bz2 |
Test global identifiers against what is specified interfaces.
Apart from calling gfc_compare_interfaces to check interfaces against
global identifiers, this also sets and check a few sym->error flags
to avoid duplicate error messages. I thought about issuing errors
on mismatched interfaces, but when the procedure is not invoked,
a warning should be enough to alert the user.
gcc/fortran/ChangeLog:
PR fortran/27318
* frontend-passes.c (check_against_globals): New function.
(gfc_check_externals): Split; also invoke check_against_globals
via gfc_traverse_ns.
(gfc_check_externals0): Recursive part formerly in
gfc_check_externals.
* resolve.c (resolve_global_procedure): Set sym->error on
interface mismatch.
* symbol.c (ambiguous_symbol): Check for, and set sym->error.
gcc/testsuite/ChangeLog:
PR fortran/27318
* gfortran.dg/error_recovery_1.f90: Adjust test case.
* gfortran.dg/use_15.f90: Likewise.
* gfortran.dg/interface_47.f90: New test.
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 5cc9f72..9c178d0 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -2634,6 +2634,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where, int sub) gfc_error ("Interface mismatch in global procedure %qs at %L: %s", sym->name, &sym->declared_at, reason); + sym->error = 1; gfc_errors_to_warnings (false); goto done; } |