gcc/testsuite/gfortran.dg/pr71862.f90
raw| 1 | ! { dg-do compile } |
| 2 | program p |
| 3 | type t |
| 4 | integer :: n = 0 |
| 5 | integer, pointer :: q => null() |
| 6 | end type |
| 7 | type(t) :: x |
| 8 | print *, associated(x%q) |
| 9 | x = f() |
| 10 | print *, associated(x%q) |
| 11 | contains |
| 12 | function f() result (z) ! { dg-error "must be dummy, allocatable or pointer" } |
| 13 | class(t) :: z |
| 14 | print *, associated(z%q) |
| 15 | end |
| 16 | end |