diff --git a/flang/lib/Semantics/check-directive-structure.h b/flang/lib/Semantics/check-directive-structure.h index c68272330f957..3ff4462eeaed6 100644 --- a/flang/lib/Semantics/check-directive-structure.h +++ b/flang/lib/Semantics/check-directive-structure.h @@ -236,7 +236,7 @@ class DirectiveStructureChecker : public virtual BaseChecker { return nullptr; } - bool CurrentDirectiveIsNested() { return dirContext_.size() > 0; }; + bool CurrentDirectiveIsNested() { return dirContext_.size() > 1; }; void SetClauseSets(D dir) { dirContext_.back().allowedClauses = directiveClausesMap_[dir].allowed;