2 ! PR fortran/109500 - check F2018:8.5.3 Note 1
4 ! The result of referencing a function whose result variable has the
5 ! ALLOCATABLE attribute is a value that does not itself have the
6 ! ALLOCATABLE attribute.
10 integer, allocatable
:: p
11 procedure(f
), pointer :: pp
14 print *, allocated (p
)
15 print *, is_allocated (p
)
16 print *, is_allocated (f()) ! { dg-error "is a function result" }
17 print *, is_allocated (pp()) ! { dg-error "is a function result" }
19 call s (f()) ! { dg-error "is a function result" }
20 call s (pp()) ! { dg-error "is a function result" }
24 integer, allocatable
:: p
28 integer, allocatable
:: f
29 allocate (f
, source
=42)
32 logical function is_allocated(p
)
33 integer, allocatable
:: p
34 is_allocated
= allocated(p
)