[flang] Check for ultimate ALLOCATABLE component in LOCAL_INIT() (#145800)
Fortran 2023 constraint C1130 disallows variables of derived type with ultimate allocatable component to appear in LOCAL_INIT().
This commit is contained in:
@@ -7278,6 +7278,14 @@ bool DeclarationVisitor::PassesLocalityChecks(
|
||||
specName);
|
||||
return false;
|
||||
}
|
||||
if (const DerivedTypeSpec *derived{type->AsDerived()}) { // F'2023 C1130
|
||||
if (auto bad{FindAllocatableUltimateComponent(*derived)}) {
|
||||
SayWithDecl(name, symbol,
|
||||
"Derived type variable '%s' with ultimate ALLOCATABLE component '%s' not allowed in a %s locality-spec"_err_en_US,
|
||||
bad.BuildResultDesignatorName(), specName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (symbol.attrs().test(Attr::ASYNCHRONOUS) && isReduce) { // F'2023 C1131
|
||||
SayWithDecl(name, symbol,
|
||||
|
||||
Reference in New Issue
Block a user