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(
731731 symbol.name (), commonBlock->name ());
732732 } else if (isLocalVariable && !IsAllocatableOrPointer (symbol) &&
733733 !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);
735736 }
736737 for (int j{0 }; j < corank; ++j) {
737738 if (auto lcbv{evaluate::ToInt64 (evaluate::Fold (
@@ -980,7 +981,7 @@ void CheckHelper::CheckObjectEntity(
980981 symbol.name (), badPotential.BuildResultDesignatorName ());
981982 } else if (isUnsavedLocal) { // F'2023 C826
982983 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,
984985 symbol.name (), badPotential.BuildResultDesignatorName ());
985986 } else {
986987 DIE (" caught unexpected bad coarray potential component" );
Original file line number Diff line number Diff line change 66program main
77 use iso_fortran_env
88 ! 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
1010 integer , parameter :: namedConst = 123
1111 codimension namedConst[* ]
1212 ! ERROR: Coarray 'coarr1' may not be in COMMON block '//'
@@ -22,7 +22,7 @@ program main
2222function func1 ()
2323 ! ERROR: Function result may not be a coarray
2424 integer :: func1[* ]
25- ! ERROR: Local coarray must have the SAVE attribute
25+ ! ERROR: Local coarray must have the SAVE or ALLOCATABLE attribute
2626 integer :: local[* ]
2727 integer , save :: saved[* ] ! ok
2828 integer :: inited[* ] = 1 ! ok
@@ -45,6 +45,6 @@ function func2()
4545 type (t), pointer :: ptr
4646 ! ERROR: Coarray 'coarr' may not have a coarray potential component '%comp'
4747 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'
4949 type (t) :: local
5050end
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ subroutine objectpointers(j)
1818 end type
1919 type (t1), target , save :: o1
2020 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'
2222 type (t1), target :: o3
2323! ERROR: An initial data target may not be a reference to an ALLOCATABLE 'x1'
2424 real , pointer :: p1 = > x1
You can’t perform that action at this time.
0 commit comments