Commit 4f283c42 by Paul Thomas

re PR fortran/67567 (resolve.c: gfc_error called with iface->module == NULL)

2013-09-26  Paul Thomas  <pault@gcc.gnu.org>

	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
parent 136429e2
2013-09-26 Paul Thomas <pault@gcc.gnu.org>
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 <kargl@gcc.gnu.org> 2015-09-25 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/67614 PR fortran/67614
...@@ -18,12 +25,12 @@ ...@@ -18,12 +25,12 @@
2015-09-21 Steven G. Kargl <kargl@gcc.gnu.org> 2015-09-21 Steven G. Kargl <kargl@gcc.gnu.org>
* resolve.c (nonscalar_typebound_assign): Fix typos in comment. * resolve.c (nonscalar_typebound_assign): Fix typos in comment.
2015-09-21 Steven G. Kargl <kargl@gcc.gnu.org> 2015-09-21 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/67615 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. arithmetic-if.
2015-09-17 Paul Thomas <pault@gcc.gnu.org> 2015-09-17 Paul Thomas <pault@gcc.gnu.org>
......
...@@ -8635,7 +8635,7 @@ resolve_transfer (gfc_code *code) ...@@ -8635,7 +8635,7 @@ resolve_transfer (gfc_code *code)
return; return;
} }
} }
if (exp->expr_type == EXPR_STRUCTURE) if (exp->expr_type == EXPR_STRUCTURE)
return; return;
...@@ -11733,6 +11733,12 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) ...@@ -11733,6 +11733,12 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
&& sym->attr.if_source == IFSRC_DECL) && sym->attr.if_source == IFSRC_DECL)
{ {
gfc_symbol *iface; 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 /* Stop the dummy characteristics test from using the interface
symbol instead of 'sym'. */ symbol instead of 'sym'. */
...@@ -11747,10 +11753,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) ...@@ -11747,10 +11753,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{ {
gfc_error ("Mismatch in PURE attribute between MODULE " gfc_error ("Mismatch in PURE attribute between MODULE "
"PROCEDURE at %L and its interface in %s", "PROCEDURE at %L and its interface in %s",
&sym->declared_at, &sym->declared_at, module_name);
/* FIXME: PR fortran/67567: iface->module should
not be NULL ! */
iface->module ? iface->module : "");
return false; return false;
} }
...@@ -11758,7 +11761,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) ...@@ -11758,7 +11761,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{ {
gfc_error ("Mismatch in ELEMENTAL attribute between MODULE " gfc_error ("Mismatch in ELEMENTAL attribute between MODULE "
"PROCEDURE at %L and its interface in %s", "PROCEDURE at %L and its interface in %s",
&sym->declared_at, iface->module); &sym->declared_at, module_name);
return false; return false;
} }
...@@ -11766,10 +11769,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) ...@@ -11766,10 +11769,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{ {
gfc_error ("Mismatch in RECURSIVE attribute between MODULE " gfc_error ("Mismatch in RECURSIVE attribute between MODULE "
"PROCEDURE at %L and its interface in %s", "PROCEDURE at %L and its interface in %s",
&sym->declared_at, &sym->declared_at, module_name);
/* FIXME: PR fortran/67567: iface->module should
not be NULL ! */
iface->module ? iface->module : "");
return false; return false;
} }
...@@ -11778,11 +11778,8 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) ...@@ -11778,11 +11778,8 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{ {
gfc_error ("%s between the MODULE PROCEDURE declaration " gfc_error ("%s between the MODULE PROCEDURE declaration "
"in module %s and the declaration at %L in " "in module %s and the declaration at %L in "
"SUBMODULE %s", errmsg, "SUBMODULE %s", errmsg, module_name,
/* FIXME: PR fortran/67567: iface->module should &sym->declared_at, submodule_name);
not be NULL ! */
iface->module ? iface->module : "",
&sym->declared_at, sym->ns->proc_name->name);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment