OSDN Git Service

2009-04-09 Janus Weil <janus@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / parse.c
index 1925198..81e4591 100644 (file)
@@ -2113,14 +2113,6 @@ loop:
          gfc_free_namespace (gfc_current_ns);
          goto loop;
        }
-      if (current_interface.type != INTERFACE_ABSTRACT &&
-        !gfc_new_block->attr.dummy &&
-        gfc_add_external (&gfc_new_block->attr, &gfc_current_locus) == FAILURE)
-       {
-         reject_statement ();
-         gfc_free_namespace (gfc_current_ns);
-         goto loop;
-       }
       break;
 
     case ST_PROCEDURE:
@@ -2213,6 +2205,10 @@ decl:
       goto decl;
     }
 
+  /* Add EXTERNAL attribute to function or subroutine.  */
+  if (current_interface.type != INTERFACE_ABSTRACT && !prog_unit->attr.dummy)
+    gfc_add_external (&prog_unit->attr, &gfc_current_locus);
+
   current_interface = save;
   gfc_add_interface (prog_unit);
   pop_state ();