From: Paul Thomas Date: Sat, 26 Sep 2015 17:52:24 +0000 (+0000) Subject: re PR fortran/67567 (resolve.c: gfc_error called with iface->module == NULL) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f283c42c79477c89dcc45d5c4f509787283f0bf;p=gcc.git re PR fortran/67567 (resolve.c: gfc_error called with iface->module == NULL) 2013-09-26 Paul Thomas PR fortran/67567 * resolve.c (resolve_fl_procedure): For module procedures, take the parent module name and the submodule name from the name of the namespace. From-SVN: r228169 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 0d39cd8391c..7d303e5a4c4 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2013-09-26 Paul Thomas + + PR fortran/67567 + * resolve.c (resolve_fl_procedure): For module procedures, take + the parent module name and the submodule name from the name of + the namespace. + 2015-09-25 Steven G. Kargl PR fortran/67614 @@ -18,12 +25,12 @@ 2015-09-21 Steven G. Kargl * resolve.c (nonscalar_typebound_assign): Fix typos in comment. - + 2015-09-21 Steven G. Kargl PR fortran/67615 - * resolve.c (gfc_resolve_code): Check for scalar expression in + * resolve.c (gfc_resolve_code): Check for scalar expression in arithmetic-if. 2015-09-17 Paul Thomas diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index c4083905776..6ae086ad0f7 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -8635,7 +8635,7 @@ resolve_transfer (gfc_code *code) return; } } - + if (exp->expr_type == EXPR_STRUCTURE) return; @@ -11733,6 +11733,12 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) && sym->attr.if_source == IFSRC_DECL) { gfc_symbol *iface; + char name[2*GFC_MAX_SYMBOL_LEN + 1]; + char *module_name; + char *submodule_name; + strcpy (name, sym->ns->proc_name->name); + module_name = strtok (name, "."); + submodule_name = strtok (NULL, "."); /* Stop the dummy characteristics test from using the interface symbol instead of 'sym'. */ @@ -11747,10 +11753,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) { gfc_error ("Mismatch in PURE attribute between MODULE " "PROCEDURE at %L and its interface in %s", - &sym->declared_at, - /* FIXME: PR fortran/67567: iface->module should - not be NULL ! */ - iface->module ? iface->module : ""); + &sym->declared_at, module_name); return false; } @@ -11758,7 +11761,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) { gfc_error ("Mismatch in ELEMENTAL attribute between MODULE " "PROCEDURE at %L and its interface in %s", - &sym->declared_at, iface->module); + &sym->declared_at, module_name); return false; } @@ -11766,10 +11769,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) { gfc_error ("Mismatch in RECURSIVE attribute between MODULE " "PROCEDURE at %L and its interface in %s", - &sym->declared_at, - /* FIXME: PR fortran/67567: iface->module should - not be NULL ! */ - iface->module ? iface->module : ""); + &sym->declared_at, module_name); return false; } @@ -11778,11 +11778,8 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) { gfc_error ("%s between the MODULE PROCEDURE declaration " "in module %s and the declaration at %L in " - "SUBMODULE %s", errmsg, - /* FIXME: PR fortran/67567: iface->module should - not be NULL ! */ - iface->module ? iface->module : "", - &sym->declared_at, sym->ns->proc_name->name); + "SUBMODULE %s", errmsg, module_name, + &sym->declared_at, submodule_name); return false; }