File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,11 @@ class CheckSpecificationExprHelper
525
525
526
526
Result operator ()(const semantics::Symbol &symbol) const {
527
527
const auto &ultimate{symbol.GetUltimate ()};
528
+ const auto *object{ultimate.detailsIf <semantics::ObjectEntityDetails>()};
529
+ bool isInitialized{semantics::IsSaved (ultimate) &&
530
+ !IsAllocatable (ultimate) && object &&
531
+ (ultimate.test (Symbol::Flag::InDataStmt) ||
532
+ object->init ().has_value ())};
528
533
if (const auto *assoc{
529
534
ultimate.detailsIf <semantics::AssocEntityDetails>()}) {
530
535
return (*this )(assoc->expr ());
@@ -554,8 +559,7 @@ class CheckSpecificationExprHelper
554
559
}
555
560
} else if (&symbol.owner () != &scope_ || &ultimate.owner () != &scope_) {
556
561
return std::nullopt; // host association is in play
557
- } else if (semantics::IsSaved (ultimate) &&
558
- semantics::IsInitialized (ultimate) &&
562
+ } else if (isInitialized &&
559
563
context_.languageFeatures ().IsEnabled (
560
564
common::LanguageFeature::SavedLocalInSpecExpr)) {
561
565
if (!scope_.IsModuleFile () &&
You can’t perform that action at this time.
0 commit comments