used_types_8.f90

来自「用于进行gcc测试」· F90 代码 · 共 47 行

F90
47
字号
! { dg-do compile }! Tests the fix for a further regression caused by the! fix for PR28788 and posted as PR28908. The problem was! caused by the patch preventing interface derived types! from associating with identical derived types in the! containing namespaces.!! Contributed by HJ Lu  <hjl@lucon.org>!module bar  implicit none  public  type ESMF_Time  sequence    integer :: MM  end type  public operator (+)  private add  interface operator (+)  module procedure add  end interfacecontains    function add (x, y)      type(ESMF_Time) :: add      type(ESMF_Time), intent(in) :: x      type(ESMF_Time), intent(in) :: y      add = x    end function addend module barmodule foo  use bar  implicit none  private  type ESMF_Clock  sequence    type(ESMF_Time)  :: CurrTime  end typecontains  subroutine ESMF_ClockAdvance(clock)  use bar    type(ESMF_Clock), intent(inout) :: clock    clock%CurrTime = clock%CurrTime + clock%CurrTime  end subroutine ESMF_ClockAdvanceend module foo! { dg-final { cleanup-modules "foo bar" } }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?