PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / typebound_call_15.f03
blob843dff4affc44ebed6155c4fb8e1ac0ac74c47c9
1 ! { dg-do compile }
3 ! PR 44558: [OOP] ICE on invalid code: called TBP subroutine as TBP function
5 ! Contributed by Hans-Werner Boschmann <boschmann@tp1.physik.uni-siegen.de>
7 module ice5
8   type::a_type
9    contains  
10      procedure::a_subroutine_1
11      procedure::a_subroutine_2
12   end type a_type
13 contains
14   real function a_subroutine_1(this)
15     class(a_type)::this
16     real::res
17     res=this%a_subroutine_2()     ! { dg-error "should be a FUNCTION" }
18   end function
19   subroutine a_subroutine_2(this)
20     class(a_type)::this
21     call this%a_subroutine_1()    ! { dg-error "should be a SUBROUTINE" }
22   end subroutine
23 end module ice5