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

            Bug ID: 77903
           Summary: gfortran 6.1.0/7.0.0 accept invalid code with
                    conflicting module/submodule interfaces
           Product: gcc
           Version: 6.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damian at sourceryinstitute dot org
  Target Milestone: ---

Gfortran accepts invalid code in which an implicitly typed interface body has
the same name as a conflicting, explicitly typed module function implemented in
a submodule.  See below.

Damian


$ cat one.f90
module one_module
  implicit none
  interface
    module function one()
    end function
  end interface
end module

submodule(one_module) one_submodule
  implicit none
contains
  integer module function one()
    one = 1
  end function
end submodule  

use one_module
print *,one()," is not ",1
end 

$ gfortran -std=f2008 -Wall -fcheck=all one.f90 

$ ./a.out
   9.18340949E-41  is not            1

$ gfortran --version
GNU Fortran (MacPorts gcc6 6.1.0_0) 6.1.0

Reply via email to