Debian Codegraph @

gcc/testsuite/gfortran.dg/interface_assignment_6.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR 45521: [F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE
4 !
5 ! Contributed by Janus Weil <[email protected]>
6
7 module inteface_assignment_6
8
9 type :: t
10 end type
11
12 ! this was rejected as ambiguous, but is valid in F08
13 interface assignment(=)
14 procedure testAlloc
15 procedure testPtr
16 end interface
17
18 contains
19
20 subroutine testAlloc(obj, val)
21 type(t), allocatable, intent(out) :: obj
22 integer, intent(in) :: val
23 end subroutine
24
25 subroutine testPtr(obj, val)
26 type(t), pointer, intent(out) :: obj
27 integer, intent(in) :: val
28 end subroutine
29
30 end