+2020-01-21 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93309
+ * interface.c (gfc_procedure_use): Also check parent namespace for
+ 'implict none (external)'.
+ * symbol.c (gfc_get_namespace): Don't set has_implicit_none_export
+ to parent namespace's setting.
+
2020-01-19 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/44960
explicitly declared at all if requested. */
if (sym->attr.if_source == IFSRC_UNKNOWN && !sym->attr.is_iso_c)
{
+ bool has_implicit_none_export = false;
implicit = true;
- if (sym->ns->has_implicit_none_export && sym->attr.proc == PROC_UNKNOWN)
+ if (sym->attr.proc == PROC_UNKNOWN)
+ for (gfc_namespace *ns = sym->ns; ns; ns = ns->parent)
+ if (ns->has_implicit_none_export)
+ {
+ has_implicit_none_export = true;
+ break;
+ }
+ if (has_implicit_none_export)
{
const char *guessed
= gfc_lookup_function_fuzzy (sym->name, sym->ns->sym_root);
}
}
- if (parent_types && ns->parent != NULL)
- ns->has_implicit_none_export = ns->parent->has_implicit_none_export;
-
ns->refs = 1;
return ns;
+2020-01-21 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93309
+ * gfortran.dg/external_implicit_none_2.f90: New.
+
2020-01-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/92328
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/93309
+!
+module m
+ implicit none(external)
+contains
+ subroutine s
+ implicit none(external) ! OK
+ end subroutine
+end module
+
+module m2
+ implicit none(external)
+contains
+ subroutine s
+ call foo(1) ! { dg-error "not explicitly declared" }
+ end subroutine
+end module
+
+module m3
+ implicit none(external)
+contains
+ subroutine s
+ implicit none(external) ! OK
+ implicit none(external) ! { dg-error "Duplicate IMPLICIT NONE statement" }
+ end subroutine
+end module