11 type(t
), target
:: tgt
12 type(t
), target
, save :: tgt2(2)
15 type(t
), pointer :: cmp1
=> tgt
! { dg-error "Pointer initialization target at .1. must have the SAVE attribute" }
19 class(t
), pointer :: cmp2
=> tgt
! { dg-error "Pointer initialization target at .1. must have the SAVE attribute" }
23 class(t
), pointer :: cmp3
=> tgt
! { dg-error "Pointer initialization target at .1. must have the SAVE attribute" }
27 integer, pointer :: cmp4
=> tgt
%i
! { dg-error "Pointer initialization target at .1. must have the SAVE attribute" }
30 type(t
), pointer :: w
=> tgt
! { dg-error "Pointer initialization target at .1. must have the SAVE attribute" }
31 class(t
), pointer :: x
=> tgt
! { dg-error "Pointer initialization target at .1. must have the SAVE attribute" }
32 class(*), pointer :: y
=> tgt
! { dg-error "Pointer initialization target at .1. must have the SAVE attribute" }
33 integer, pointer :: z
=> tgt
%i
! { dg-error "Pointer initialization target at .1. must have the SAVE attribute" }
41 type(t3
), target
:: tgt
44 type(t3
), pointer :: cmp1
=> tgt
! OK
45 class(t3
), pointer :: cmp2
=> tgt
! OK
46 class(t3
), pointer :: cmp3
=> tgt
! OK
47 integer, pointer :: cmp4
=> tgt
%j
! OK
50 type(t3
), target
:: mytarget
52 type(t3
), pointer :: a
=> mytarget
! OK
53 class(t3
), pointer :: b
=> mytarget
! OK
54 class(*), pointer :: c
=> mytarget
! OK
55 integer, pointer :: d
=> mytarget
%j
! OK