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

kargl at gcc dot gnu.org changed:

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

--- Comment #4 from kargl at gcc dot gnu.org ---
This patch

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 280157)
+++ gcc/fortran/resolve.c       (working copy)
@@ -13242,7 +13254,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)

 check_formal:
       /* Check the characteristics of the formal arguments.  */
-      if (sym->formal && sym->formal_ns)
+      if (sym->formal && iface->formal && sym->formal_ns)
        {
          for (arg = sym->formal; arg && arg->sym; arg = arg->next)
            {

allows Damian's example to compile without error.

Damian's use of 'module precedure' is backwards from the way I
use it.  That is, I use it to construct generic interfaces
like

module foo
  private
  public bar
  interface bar ! Make bar generic
    module procedure bar1
    module procedure bar2
  end interface
  contains
    subroutine bar1(x)
       real x
    end subroutine bar1
    subroutine bar2(x)
       double precision x
    end subroutine bar2
end module foo

It seems strange to me to put a subroutine interface in
an interface construct, and then in the 'contain' section of
a module simply using 'module procedure bar' where there are
no details of the interface and implementation details occur.

I do not know if the patch permits valid Fortran to compile,
nor I have regression tested the patch, nor do I care.

Reply via email to