use_7.f90

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

F90
50
字号
! { dg-do compile }! Renaming of operatorsmodule z  type myT    integer :: t  end type myT  interface operator(+)    module procedure sub2  end interfacecontainsfunction sub2(x)  type(myT) :: sub2  type(myT),intent(in) :: x  sub2%t = x%t + 5end function sub2end module zmodule y  interface operator(.addfive.)    module procedure sub  end interfacecontainsfunction sub(x)  integer :: sub  integer,intent(in) :: x  sub = x + 15end function subend module ymodule x  interface operator(.addfive.)    module procedure sub  end interfacecontainsfunction sub(x)  integer :: sub  integer,intent(in) :: x  sub = x + 25end function subend module xuse z, operator(-) => operator(+) ! { dg-error "Syntax error in USE statement" }use z, operator(.op.) => operator(+) ! { dg-error "Syntax error in USE statement" }use x, only : bar => operator(.addfive.) ! { dg-error "Syntax error in USE statement" }use y, operator(.my.) => sub ! { dg-error "Syntax error in USE statement" }use y, operator(+) => operator(.addfive.) ! { dg-error "Syntax error in USE statement" }end! { dg-final { cleanup-modules "x y z" } }

⌨️ 快捷键说明

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