aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/null_7.f90
blob: d6d77d2b0a40aedcff7e449354abd3cc0c053b61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do compile }
!
! PR fortran/55763
!

implicit none
integer, pointer :: x
class(*), pointer :: y
integer, pointer :: p1 => null(x) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
integer, pointer :: p2 => null(mold=x) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
class(*), pointer :: p3 =>null(x) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
type t
  real, pointer :: a1 => null(x) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
  real, pointer :: a2 => null ( mold = x) ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
  class(*), pointer :: a3 => null(mold = x )  ! { dg-error "NULL.. initialization at .1. may not have MOLD" }
end type t

x => null(x) ! OK
y => null(y) ! OK
end