------- Comment #4 from janus at gcc dot gnu dot org  2009-06-17 09:26 -------
Mine. Here's a patch:

Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c        (revision 148518)
+++ gcc/fortran/symbol.c        (working copy)
@@ -317,7 +317,7 @@ gfc_check_function_type (gfc_namespace *
   if (!proc->attr.contained || proc->result->attr.implicit_type)
     return;

-  if (proc->result->ts.type == BT_UNKNOWN)
+  if (proc->result->ts.type == BT_UNKNOWN && proc->result->ts.interface ==
NULL)
     {
       if (gfc_set_default_type (proc->result, 0, gfc_current_ns)
                == SUCCESS)
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 148519)
+++ gcc/fortran/resolve.c       (working copy)
@@ -347,7 +347,7 @@ resolve_contained_fntype (gfc_symbol *sy
     return;

   /* Try to find out of what the return type is.  */
-  if (sym->result->ts.type == BT_UNKNOWN)
+  if (sym->result->ts.type == BT_UNKNOWN && sym->result->ts.interface == NULL)
     {
       t = gfc_set_default_type (sym->result, 0, ns);


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-06-17 08:33:58         |2009-06-17 09:26:05
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40451

Reply via email to