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) {
154154 } else if (evaluate::IsAssumedRank (lhs)) {
155155 Say (" The left-hand side of a pointer assignment must not be an assumed-rank dummy argument" _err_en_US);
156156 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 ;
157160 } else {
158161 return true ;
159162 }
@@ -177,7 +180,7 @@ bool PointerAssignmentChecker::Check(const SomeExpr &rhs) {
177180 Say (" An array section with a vector subscript may not be a pointer target" _err_en_US);
178181 return false ;
179182 }
180- if (ExtractCoarrayRef (rhs)) { // C1026
183+ if (ExtractCoarrayRef (rhs)) { // F'2023 C1029
181184 Say (" A coindexed object may not be a pointer target" _err_en_US);
182185 return false ;
183186 }
Original file line number Diff line number Diff line change @@ -146,14 +146,25 @@ function f2()
146146 end
147147 end
148148
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.
150150 subroutine s10
151151 real , target , save :: a[* ]
152152 real , pointer :: b
153153 ! ERROR: A coindexed object may not be a pointer target
154154 b = > a[1 ]
155155 end
156156
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+
157168end
158169
159170module m2
You can’t perform that action at this time.
0 commit comments