generic_14.f90
来自「用于进行gcc测试」· F90 代码 · 共 106 行
F90
106 行
! { dg-do compile }!! Check whether MODULE PROCEDUREs are properly treated! They need to be contained in a procedure, i.e. an! interface in another procedure is invalid; they may, however,! come from a use-associated procedure.! (The PROCEDURE statement allows also for non-module procedures! if there is an explicit interface.)!! PR fortran/33228!module inclmod implicit none interface subroutine wrong1(a) integer :: a end subroutine wrong1 end interface interface gen_incl module procedure ok1 end interface gen_incl external wrong2 external wrong3 real wrong3contains subroutine ok1(f) character :: f end subroutine ok1end module inclmodmodule a use inclmod implicit none interface gen subroutine ok1_a(a,b) integer :: a,b end subroutine ok1_a module procedure ok1, ok2_a end interface gencontains subroutine ok2_a(a,b,c) integer :: a,b,c end subroutine ok2_aend module amodule b use inclmod interface gen_wrong_0 module procedure gen_incl ! { dg-error "Cannot change attributes" } end interface gen_wrong_0end module bmodule c use inclmod interface gen_wrong_1 module procedure wrong1 ! { dg-error "is not a module procedure" } end interface gen_wrong_1end module cmodule d use inclmod interface gen_wrong_2 module procedure wrong2 ! { dg-error "Cannot change attributes" } end interface gen_wrong_2end module dmodule e use inclmod interface gen_wrong_3 module procedure wrong3 ! { dg-error "Cannot change attributes" } end interface gen_wrong_3end module emodule f implicit none interface subroutine wrong_a(a) integer :: a end subroutine wrong_a end interface interface gen_wrong_4 module procedure wrong_a ! { dg-error "is not a module procedure" } end interface gen_wrong_4end module fmodule g implicit none external wrong_b ! { dg-error "has no explicit interface" } interface gen_wrong_5 module procedure wrong_b ! wrong, see above end interface gen_wrong_5end module gmodule h implicit none external wrong_c ! { dg-error "has no explicit interface" } real wrong_c interface gen_wrong_6 module procedure wrong_c ! wrong, see above end interface gen_wrong_6end module hend! { dg-final { cleanup-modules "a inclmod" } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?