diff --git a/flang/lib/Semantics/check-directive-structure.h b/flang/lib/Semantics/check-directive-structure.h --- a/flang/lib/Semantics/check-directive-structure.h +++ b/flang/lib/Semantics/check-directive-structure.h @@ -232,8 +232,6 @@ // Check that only clauses in set are after the specific clauses. void CheckOnlyAllowedAfter(C clause, common::EnumSet set); - void CheckRequired(C clause); - void CheckRequireAtLeastOneOf(); void CheckAllowed(C clause); @@ -326,6 +324,8 @@ template void DirectiveStructureChecker::CheckRequireAtLeastOneOf() { + if (GetContext().requiredClauses.empty()) + return; for (auto cl : GetContext().actualClauses) { if (GetContext().requiredClauses.test(cl)) return; @@ -447,17 +447,6 @@ .Attach(beginSource, "Does not match directive"_en_US); } -// Check that at least one of the required clauses is present on the directive. -template -void DirectiveStructureChecker::CheckRequired(C c) { - if (!FindClause(c)) { - context_.Say(GetContext().directiveSource, - "At least one %s clause must appear on the %s directive"_err_en_US, - parser::ToUpperCaseLetters(getClauseName(c).str()), - ContextDirectiveAsFortran()); - } -} - // Check the value of the clause is a positive parameter. template void DirectiveStructureChecker