aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2015-09-26 17:52:24 +0000
committerPaul Thomas <pault@gcc.gnu.org>2015-09-26 17:52:24 +0000
commit4f283c42c79477c89dcc45d5c4f509787283f0bf (patch)
tree89f40dae225a9e34b6e615af47e825a3dc69353c
parent136429e2b7719fb3accd307327bd8816e251af66 (diff)
downloadgcc-4f283c42c79477c89dcc45d5c4f509787283f0bf.zip
gcc-4f283c42c79477c89dcc45d5c4f509787283f0bf.tar.gz
gcc-4f283c42c79477c89dcc45d5c4f509787283f0bf.tar.bz2
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
-rw-r--r--gcc/fortran/ChangeLog11
-rw-r--r--gcc/fortran/resolve.c27
2 files changed, 21 insertions, 17 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 0d39cd8..7d303e5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+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>
PR fortran/67614
@@ -18,12 +25,12 @@
2015-09-21 Steven G. Kargl <kargl@gcc.gnu.org>
* resolve.c (nonscalar_typebound_assign): Fix typos in comment.
-
+
2015-09-21 Steven G. Kargl <kargl@gcc.gnu.org>
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 <pault@gcc.gnu.org>
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index c408390..6ae086a 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;
}