[Bug fortran/77903] [F08] gfortran 6.1.0/7.0.0 accept invalid code with conflicting module/submodule interfaces

pault at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Dec 3 17:53:00 GMT 2016


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

--- Comment #9 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 40237
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40237&action=edit
Fix for the PR

This is still a bit rough round the edges but it fixes the PR, regtests and
bootstraps with this testcase:

! { dg-do compile }
!
! Test the fix for PR77903
!
! Contributed by Damian Rouson  <damian@sourceryinstitute.org>
!
module one_module
  implicit none
  interface
    module function one()
    end function
    integer module function two()
    end function
  end interface
end module

submodule(one_module) one_submodule
  implicit none
contains
  integer module function one()  ! { dg-error "Type mismatch" }
    one = 1
  end function
  integer(8) module function two()  ! { dg-error "Type mismatch" }
    two = 2
  end function
end submodule

I am back in France tomorrow night and will tidy up and submit on Monday.

Cheers

Paul


More information about the Gcc-bugs mailing list