File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -731,7 +731,8 @@ void CheckHelper::CheckObjectEntity(
731
731
symbol.name (), commonBlock->name ());
732
732
} else if (isLocalVariable && !IsAllocatableOrPointer (symbol) &&
733
733
!IsSaved (symbol)) {
734
- messages_.Say (" Local coarray must have the SAVE attribute" _err_en_US);
734
+ messages_.Say (
735
+ " Local coarray must have the SAVE or ALLOCATABLE attribute" _err_en_US);
735
736
}
736
737
for (int j{0 }; j < corank; ++j) {
737
738
if (auto lcbv{evaluate::ToInt64 (evaluate::Fold (
@@ -980,7 +981,7 @@ void CheckHelper::CheckObjectEntity(
980
981
symbol.name (), badPotential.BuildResultDesignatorName ());
981
982
} else if (isUnsavedLocal) { // F'2023 C826
982
983
SayWithDeclaration (*badPotential,
983
- " Local variable '%s' without the SAVE attribute may not have a coarray potential subobject component '%s'" _err_en_US,
984
+ " Local variable '%s' without the SAVE or ALLOCATABLE attribute may not have a coarray potential subobject component '%s'" _err_en_US,
984
985
symbol.name (), badPotential.BuildResultDesignatorName ());
985
986
} else {
986
987
DIE (" caught unexpected bad coarray potential component" );
Original file line number Diff line number Diff line change 6
6
program main
7
7
use iso_fortran_env
8
8
! ERROR: Coarray 'namedconst' may not be a named constant
9
- ! ERROR: Local coarray must have the SAVE attribute
9
+ ! ERROR: Local coarray must have the SAVE or ALLOCATABLE attribute
10
10
integer , parameter :: namedConst = 123
11
11
codimension namedConst[* ]
12
12
! ERROR: Coarray 'coarr1' may not be in COMMON block '//'
@@ -22,7 +22,7 @@ program main
22
22
function func1 ()
23
23
! ERROR: Function result may not be a coarray
24
24
integer :: func1[* ]
25
- ! ERROR: Local coarray must have the SAVE attribute
25
+ ! ERROR: Local coarray must have the SAVE or ALLOCATABLE attribute
26
26
integer :: local[* ]
27
27
integer , save :: saved[* ] ! ok
28
28
integer :: inited[* ] = 1 ! ok
@@ -45,6 +45,6 @@ function func2()
45
45
type (t), pointer :: ptr
46
46
! ERROR: Coarray 'coarr' may not have a coarray potential component '%comp'
47
47
type (t), save :: coarr[* ]
48
- ! ERROR: Local variable 'local' without the SAVE attribute may not have a coarray potential subobject component '%comp'
48
+ ! ERROR: Local variable 'local' without the SAVE or ALLOCATABLE attribute may not have a coarray potential subobject component '%comp'
49
49
type (t) :: local
50
50
end
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ subroutine objectpointers(j)
18
18
end type
19
19
type (t1), target , save :: o1
20
20
type (t1), save :: o2
21
- ! ERROR: Local variable 'o3' without the SAVE attribute may not have a coarray potential subobject component '%c2'
21
+ ! ERROR: Local variable 'o3' without the SAVE or ALLOCATABLE attribute may not have a coarray potential subobject component '%c2'
22
22
type (t1), target :: o3
23
23
! ERROR: An initial data target may not be a reference to an ALLOCATABLE 'x1'
24
24
real , pointer :: p1 = > x1
You can’t perform that action at this time.
0 commit comments