File tree Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -261,19 +261,6 @@ void CheckHelper::Check(const Symbol &symbol) {
261
261
CheckExplicitSave (symbol);
262
262
}
263
263
const auto *object{symbol.detailsIf <ObjectEntityDetails>()};
264
- if (symbol.attrs ().test (Attr::CONTIGUOUS)) {
265
- if ((!object && !symbol.has <UseDetails>()) ||
266
- !((IsPointer (symbol) && symbol.Rank () > 0 ) || IsAssumedShape (symbol) ||
267
- evaluate::IsAssumedRank (symbol))) {
268
- if (symbol.owner ().IsDerivedType ()) { // C752
269
- messages_.Say (
270
- " A CONTIGUOUS component must be an array with the POINTER attribute" _err_en_US);
271
- } else { // C830
272
- messages_.Say (
273
- " CONTIGUOUS entity must be an array pointer, assumed-shape, or assumed-rank" _err_en_US);
274
- }
275
- }
276
- }
277
264
CheckGlobalName (symbol);
278
265
if (isDone) {
279
266
return ; // following checks do not apply
@@ -848,6 +835,17 @@ void CheckHelper::CheckObjectEntity(
848
835
" '%s' is a data object and may not be EXTERNAL" _err_en_US,
849
836
symbol.name ());
850
837
}
838
+ if (symbol.attrs ().test (Attr::CONTIGUOUS)) {
839
+ if ((IsPointer (symbol) && symbol.Rank () > 0 ) || IsAssumedShape (symbol) ||
840
+ evaluate::IsAssumedRank (symbol)) {
841
+ } else if (symbol.owner ().IsDerivedType ()) { // C752
842
+ messages_.Say (
843
+ " A CONTIGUOUS component must be an array with the POINTER attribute" _err_en_US);
844
+ } else { // C830
845
+ messages_.Say (
846
+ " CONTIGUOUS entity must be an array pointer, assumed-shape, or assumed-rank" _err_en_US);
847
+ }
848
+ }
851
849
}
852
850
853
851
void CheckHelper::CheckPointerInitialization (const Symbol &symbol) {
Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ program p2
27
27
contiguous w
28
28
! ERROR: 'z' is use-associated from module 'm2' and cannot be re-declared
29
29
integer z
30
+ real , target :: a(10 )
31
+ real , contiguous, pointer :: p(:) = > a
30
32
! ERROR: Reference to 'y' is ambiguous
31
33
y = 1
34
+ contains
35
+ subroutine inner
36
+ p(1 ) = 0 . ! ok - check for regression on contiguous host assoc.
37
+ end subroutine
32
38
end
You can’t perform that action at this time.
0 commit comments