@@ -8,6 +8,17 @@ subroutine objectpointers(j)
8
8
real , save :: x3
9
9
real , target :: x4
10
10
real , target , save :: x5(10 )
11
+ real , pointer :: x6
12
+ type t1
13
+ real , allocatable :: c1
14
+ real , allocatable , codimension[:] :: c2
15
+ real :: c3
16
+ real :: c4(10 )
17
+ real , pointer :: c5
18
+ end type
19
+ type (t1), target , save :: o1
20
+ type (t1), save :: o2
21
+ type (t1), target :: o3
11
22
! ERROR: An initial data target may not be a reference to an ALLOCATABLE 'x1'
12
23
real , pointer :: p1 = > x1
13
24
! ERROR: An initial data target may not be a reference to a coarray 'x2'
@@ -20,6 +31,52 @@ subroutine objectpointers(j)
20
31
real , pointer :: p5 = > x5(j)
21
32
! ERROR: Pointer has rank 0 but target has rank 1
22
33
real , pointer :: p6 = > x5
34
+ ! ERROR: An initial data target may not be a reference to a POINTER 'x6'
35
+ real , pointer :: p7 = > x6
36
+ ! ERROR: An initial data target may not be a reference to an ALLOCATABLE 'c1'
37
+ real , pointer :: p1o = > o1% c1
38
+ ! ERROR: An initial data target may not be a reference to a coarray 'c2'
39
+ real , pointer :: p2o = > o1% c2
40
+ ! ERROR: An initial data target may not be a reference to an object 'o2' that lacks the TARGET attribute
41
+ real , pointer :: p3o = > o2% c3
42
+ ! ERROR: An initial data target may not be a reference to an object 'o3' that lacks the SAVE attribute
43
+ real , pointer :: p4o = > o3% c3
44
+ ! ERROR: An initial data target must be a designator with constant subscripts
45
+ real , pointer :: p5o = > o1% c4(j)
46
+ ! ERROR: Pointer has rank 0 but target has rank 1
47
+ real , pointer :: p6o = > o1% c4
48
+ ! ERROR: An initial data target may not be a reference to a POINTER 'c5'
49
+ real , pointer :: p7o = > o1% c5
50
+ type t2
51
+ ! ERROR: An initial data target may not be a reference to an ALLOCATABLE 'x1'
52
+ real , pointer :: p1 = > x1
53
+ ! ERROR: An initial data target may not be a reference to a coarray 'x2'
54
+ real , pointer :: p2 = > x2
55
+ ! ERROR: An initial data target may not be a reference to an object 'x3' that lacks the TARGET attribute
56
+ real , pointer :: p3 = > x3
57
+ ! ERROR: An initial data target may not be a reference to an object 'x4' that lacks the SAVE attribute
58
+ real , pointer :: p4 = > x4
59
+ ! ERROR: An initial data target must be a designator with constant subscripts
60
+ real , pointer :: p5 = > x5(j)
61
+ ! ERROR: Pointer has rank 0 but target has rank 1
62
+ real , pointer :: p6 = > x5
63
+ ! ERROR: An initial data target may not be a reference to a POINTER 'x6'
64
+ real , pointer :: p7 = > x6
65
+ ! ERROR: An initial data target may not be a reference to an ALLOCATABLE 'c1'
66
+ real , pointer :: p1o = > o1% c1
67
+ ! ERROR: An initial data target may not be a reference to a coarray 'c2'
68
+ real , pointer :: p2o = > o1% c2
69
+ ! ERROR: An initial data target may not be a reference to an object 'o2' that lacks the TARGET attribute
70
+ real , pointer :: p3o = > o2% c3
71
+ ! ERROR: An initial data target may not be a reference to an object 'o3' that lacks the SAVE attribute
72
+ real , pointer :: p4o = > o3% c3
73
+ ! ERROR: An initial data target must be a designator with constant subscripts
74
+ real , pointer :: p5o = > o1% c4(j)
75
+ ! ERROR: Pointer has rank 0 but target has rank 1
76
+ real , pointer :: p6o = > o1% c4
77
+ ! ERROR: An initial data target may not be a reference to a POINTER 'c5'
78
+ real , pointer :: p7o = > o1% c5
79
+ end type
23
80
24
81
! TODO: type incompatibility, non-deferred type parameter values, contiguity
25
82
0 commit comments