https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118796

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #18 from anlauf at gcc dot gnu.org ---
(In reply to Sam James from comment #17)
> r15-3323-gb222122d4e93de

The reduced testcase in comment#15 is fixed by the following patch which
modifies this commit:

diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index cf9318ff763..08e311648c8 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -17946,7 +17997,8 @@ skip_interfaces:
        /* Mark the result symbol to be referenced, when it has allocatable
           components.  */
        sym->result->attr.referenced = 1;
-      else if (a->function && !a->pointer && !a->allocatable && sym->result)
+      else if (a->function && !a->pointer && !a->allocatable
+              && !a->use_assoc && sym->result)
        /* Default initialization for function results.  */
        apply_default_init (sym->result);
     }

This sort of papers over the underlying issue that the resolution of symbol z
looks at the wrong namespace, but works here.

Regtesting is still running here.

Does is fix the original issue?

Reply via email to