diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-08-15 22:52:40 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-08-15 22:52:40 +0000 |
commit | fb078366c749168c86a97df8423eb0b8f2c948b2 (patch) | |
tree | a1402a54686f1b73e81b7548effd9221a7061b04 /gcc/fortran/resolve.c | |
parent | 7148dede8a84e17cc0b00190d76fabbc1a717654 (diff) | |
download | gcc-fb078366c749168c86a97df8423eb0b8f2c948b2.zip gcc-fb078366c749168c86a97df8423eb0b8f2c948b2.tar.gz gcc-fb078366c749168c86a97df8423eb0b8f2c948b2.tar.bz2 |
re PR fortran/91443 (-Wargument-mismatch does not catch mismatch for global procedure)
2019-08-15 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/91443
* frontend-passes.c (check_externals_expr): New function.
(check_externals_code): New function.
(gfc_check_externals): New function.
* gfortran.h (debug): Add prototypes for gfc_symbol * and
gfc_expr *.
(gfc_check_externals): Add prototype.
* interface.c (compare_actual_formal): Do not complain about
alternate returns if the formal argument is optional.
(gfc_procedure_use): Handle cases when an error has been issued
previously. Break long line.
* parse.c (gfc_parse_file): Call gfc_check_externals for all
external procedures.
* resolve.c (resolve_global_procedure): Remove checking of
argument list.
2019-08-15 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/91443
* gfortran.dg/argument_checking_19.f90: New test.
* gfortran.dg/altreturn_10.f90: Change dg-warning to dg-error.
* gfortran.dg/dec_union_11.f90: Add -std=legacy.
* gfortran.dg/hollerith8.f90: Likewise. Remove warning for
Hollerith constant.
* gfortran.dg/integer_exponentiation_2.f90: New subroutine gee_i8;
use it to avoid type mismatches.
* gfortran.dg/pr41011.f: Add -std=legacy.
* gfortran.dg/whole_file_1.f90: Change warnings to errors.
* gfortran.dg/whole_file_2.f90: Likewise.
From-SVN: r274551
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index ac9192a..1f48045 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -2506,8 +2506,7 @@ gfc_explicit_interface_required (gfc_symbol *sym, char *errmsg, int err_len) static void -resolve_global_procedure (gfc_symbol *sym, locus *where, - gfc_actual_arglist **actual, int sub) +resolve_global_procedure (gfc_symbol *sym, locus *where, int sub) { gfc_gsymbol * gsym; gfc_namespace *ns; @@ -2615,14 +2614,6 @@ resolve_global_procedure (gfc_symbol *sym, locus *where, " %s", sym->name, &sym->declared_at, reason); goto done; } - - if (!pedantic - || ((gfc_option.warn_std & GFC_STD_LEGACY) - && !(gfc_option.warn_std & GFC_STD_GNU))) - gfc_errors_to_warnings (true); - - if (sym->attr.if_source != IFSRC_IFBODY) - gfc_procedure_use (def_sym, actual, where); } done: @@ -3198,8 +3189,7 @@ resolve_function (gfc_expr *expr) /* If the procedure is external, check for usage. */ if (sym && is_external_proc (sym)) - resolve_global_procedure (sym, &expr->where, - &expr->value.function.actual, 0); + resolve_global_procedure (sym, &expr->where, 0); if (sym && sym->ts.type == BT_CHARACTER && sym->ts.u.cl @@ -3675,7 +3665,7 @@ resolve_call (gfc_code *c) /* If external, check for usage. */ if (csym && is_external_proc (csym)) - resolve_global_procedure (csym, &c->loc, &c->ext.actual, 1); + resolve_global_procedure (csym, &c->loc, 1); t = true; if (c->resolved_sym == NULL) |