File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -7278,6 +7278,14 @@ bool DeclarationVisitor::PassesLocalityChecks(
72787278 specName);
72797279 return false ;
72807280 }
7281+ if (const DerivedTypeSpec *derived{type->AsDerived ()}) { // F'2023 C1130
7282+ if (auto bad{FindAllocatableUltimateComponent (*derived)}) {
7283+ SayWithDecl (name, symbol,
7284+ " Derived type variable '%s' with ultimate ALLOCATABLE component '%s' not allowed in a %s locality-spec" _err_en_US,
7285+ bad.BuildResultDesignatorName (), specName);
7286+ return false ;
7287+ }
7288+ }
72817289 }
72827290 if (symbol.attrs ().test (Attr::ASYNCHRONOUS) && isReduce) { // F'2023 C1131
72837291 SayWithDecl (name, symbol,
Original file line number Diff line number Diff line change @@ -94,3 +94,23 @@ subroutine s8(arg)
9494 do concurrent(i= 1 :5 ) local(arg)
9595 end do
9696end subroutine s8
97+
98+ subroutine s9 ()
99+ type l3
100+ integer , allocatable :: a
101+ end type
102+ type l2
103+ type (l3) :: l2_3
104+ end type
105+ type l1
106+ type (l2) :: l1_2
107+ end type
108+ type (l1) :: v
109+ integer sum
110+
111+ sum = 0
112+ ! ERROR: Derived type variable 'v' with ultimate ALLOCATABLE component '%l1_2%l2_3%a' not allowed in a LOCAL_INIT locality-spec
113+ do concurrent (i = 1 :10 ) local_init(v)
114+ sum = sum + i
115+ end do
116+ end subroutine s9
You can’t perform that action at this time.
0 commit comments