+2020-03-28 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/94348
+ * decl.c (gfc_match_submod_proc): Add result var to the
+ proc's namespace.
+
2020-03-27 Tobias Burnus <tobias@codesourcery.com>
PR fortran/93957
if (get_proc_name (name, &sym, false))
return MATCH_ERROR;
- /* Make sure that the result field is appropriately filled, even though
- the result symbol will be replaced later on. */
+ /* Make sure that the result field is appropriately filled. */
if (sym->tlink && sym->tlink->attr.function)
{
- if (sym->tlink->result
- && sym->tlink->result != sym->tlink)
- sym->result= sym->tlink->result;
+ if (sym->tlink->result && sym->tlink->result != sym->tlink)
+ {
+ sym->result = sym->tlink->result;
+ if (!sym->result->attr.use_assoc)
+ {
+ gfc_symtree *st = gfc_new_symtree (&gfc_current_ns->sym_root,
+ sym->result->name);
+ st->n.sym = sym->result;
+ sym->result->refs++;
+ }
+ }
else
sym->result = sym;
}