Fortran: This patch fixes comments 23 and 24 of PR96320.
[gcc.git] / gcc / fortran / decl.c
index 4771b591f1ab9799bbea3a243207ab649941acf9..723915822f33129bc44e218401b2c9382be0e150 100644 (file)
@@ -9856,7 +9856,8 @@ gfc_match_modproc (void)
   gfc_namespace *module_ns;
   gfc_interface *old_interface_head, *interface;
 
-  if (gfc_state_stack->state != COMP_INTERFACE
+  if ((gfc_state_stack->state != COMP_INTERFACE
+       && gfc_state_stack->state != COMP_CONTAINS)
       || gfc_state_stack->previous == NULL
       || current_interface.type == INTERFACE_NAMELESS
       || current_interface.type == INTERFACE_ABSTRACT)