111
|
1 ! { dg-do compile }
|
|
2 !
|
|
3 ! PR fortran/55763
|
|
4 !
|
|
5
|
|
6 implicit none
|
|
7 integer, pointer :: x
|
|
8 class(*), pointer :: y
|
|
9 integer, pointer :: p1 => null(x) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
|
|
10 integer, pointer :: p2 => null(mold=x) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
|
|
11 class(*), pointer :: p3 =>null(x) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
|
|
12 type t
|
|
13 real, pointer :: a1 => null(x) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
|
|
14 real, pointer :: a2 => null ( mold = x) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
|
|
15 class(*), pointer :: a3 => null(mold = x ) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
|
|
16 end type t
|
|
17
|
|
18 x => null(x) ! OK
|
|
19 y => null(y) ! OK
|
|
20 end
|