Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/interface_derived_type_1.f90 @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
! { dg-do compile } ! Test the fix for PR20903, in which derived types could be host associated within ! interface bodies. ! ! Contributed by Joost VandeVondele <jv244@cam.ac.uk> ! module test implicit none type fcnparms integer :: i end type fcnparms contains subroutine sim_1(func1,params) interface function func1(fparams) type(fcnparms) :: fparams ! { dg-error "is being used before it is defined" } real :: func1 end function func1 end interface type(fcnparms) :: params end subroutine sim_1 subroutine sim_2(func2,params) interface function func2(fparams) ! This is OK because of the derived type decl. type fcnparms integer :: i end type fcnparms type(fcnparms) :: fparams real :: func2 end function func2 end interface type(fcnparms) :: params ! This is OK, of course end subroutine sim_2 end module test module type_decl implicit none type fcnparms integer :: i end type fcnparms end module type_decl subroutine sim_3(func3,params) use type_decl interface function func3(fparams) use type_decl type(fcnparms) :: fparams ! This is OK - use associated real :: func3 end function func3 end interface type(fcnparms) :: params ! -ditto- end subroutine sim_3