File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,9 @@ bool PointerAssignmentChecker::CheckLeftHandSide(const SomeExpr &lhs) {
154
154
} else if (evaluate::IsAssumedRank (lhs)) {
155
155
Say (" The left-hand side of a pointer assignment must not be an assumed-rank dummy argument" _err_en_US);
156
156
return false ;
157
+ } else if (evaluate::ExtractCoarrayRef (lhs)) { // F'2023 C1027
158
+ Say (" The left-hand side of a pointer assignment must not be coindexed" _err_en_US);
159
+ return false ;
157
160
} else {
158
161
return true ;
159
162
}
@@ -177,7 +180,7 @@ bool PointerAssignmentChecker::Check(const SomeExpr &rhs) {
177
180
Say (" An array section with a vector subscript may not be a pointer target" _err_en_US);
178
181
return false ;
179
182
}
180
- if (ExtractCoarrayRef (rhs)) { // C1026
183
+ if (ExtractCoarrayRef (rhs)) { // F'2023 C1029
181
184
Say (" A coindexed object may not be a pointer target" _err_en_US);
182
185
return false ;
183
186
}
Original file line number Diff line number Diff line change @@ -146,14 +146,25 @@ function f2()
146
146
end
147
147
end
148
148
149
- ! C1026 (R1037) A data-target shall not be a coindexed object.
149
+ ! F'2023 C1029 A data-target shall not be a coindexed object.
150
150
subroutine s10
151
151
real , target , save :: a[* ]
152
152
real , pointer :: b
153
153
! ERROR: A coindexed object may not be a pointer target
154
154
b = > a[1 ]
155
155
end
156
156
157
+ ! F'2023 C1027 the LHS may not be coindexed
158
+ subroutine s11
159
+ type t
160
+ real , pointer :: p
161
+ end type
162
+ type (t), save :: ca[* ]
163
+ real , target :: x
164
+ ! ERROR: The left-hand side of a pointer assignment must not be coindexed
165
+ ca[1 ]% p = > x
166
+ end
167
+
157
168
end
158
169
159
170
module m2
You can’t perform that action at this time.
0 commit comments