]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/fortran/resolve.c
primary.c (gfc_match_rvalue): Only apply implicit type if variable does not have...
[thirdparty/gcc.git] / gcc / fortran / resolve.c
index 0e17c4be5e71ff0c9afed469dc69ce0632c7e9a9..c3bf35057df9d5f354b98189f74de8cfce03981a 100644 (file)
@@ -259,27 +259,13 @@ resolve_contained_fntype (gfc_symbol * sym, gfc_namespace * ns)
           || sym->attr.flavor == FL_VARIABLE))
     return;
 
-  /* Try to find out of what type the function is.  If there was an
-     explicit RESULT clause, try to get the type from it.  If the
-     function is never defined, set it to the implicit type.  If
-     even that fails, give up.  */
+  /* Try to find out of what the return type is.  */
   if (sym->result != NULL)
     sym = sym->result;
 
   if (sym->ts.type == BT_UNKNOWN)
     {
-      /* Assume we can find an implicit type.  */
-      t = SUCCESS;
-
-      if (sym->result == NULL)
-       t = gfc_set_default_type (sym, 0, ns);
-      else
-       {
-         if (sym->result->ts.type == BT_UNKNOWN)
-           t = gfc_set_default_type (sym->result, 0, NULL);
-
-         sym->ts = sym->result->ts;
-       }
+      t = gfc_set_default_type (sym, 0, ns);
 
       if (t == FAILURE)
        gfc_error ("Contained function '%s' at %L has no IMPLICIT type",