view gcc/testsuite/gfortran.dg/null_7.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { 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