diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h index 23b4a9517192c6..1a4ec43705bc32 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -8965,9 +8965,7 @@ class OMPChildren final const CapturedStmt * getCapturedStmt(OpenMPDirectiveKind RegionKind, ArrayRef CaptureRegions) const { - assert(llvm::any_of( - CaptureRegions, - [=](const OpenMPDirectiveKind K) { return K == RegionKind; }) && + assert(llvm::is_contained(CaptureRegions, RegionKind) && "RegionKind not found in OpenMP CaptureRegions."); auto *CS = cast(getAssociatedStmt()); for (auto ThisCaptureRegion : CaptureRegions) {