[clang] [Basic] Use llvm::erase_if (NFC) (PR #140309)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Fri May 16 14:20:11 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/140309
None
>From dd892e582c3671e53911d15f2a3e5d3bec9fca9b Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 15 May 2025 21:28:40 -0700
Subject: [PATCH] [Basic] Use llvm::erase_if (NFC)
---
clang/lib/Basic/Diagnostic.cpp | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 586273ab88bd3..a23ac7794d86c 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -535,10 +535,7 @@ void WarningsSpecialCaseList::processSections(DiagnosticsEngine &Diags) {
// FIXME: We should make this configurable in the parser instead.
// FIXME: C++20 can use std::erase_if(Sections, [](Section &sec) { return
// sec.SectionStr == "*"; });
- Sections.erase(
- std::remove_if(Sections.begin(), Sections.end(),
- [](Section &sec) { return sec.SectionStr == "*"; }),
- Sections.end());
+ llvm::erase_if(Sections, [](Section &sec) { return sec.SectionStr == "*"; });
// Make sure we iterate sections by their line numbers.
std::vector<std::pair<unsigned, const Section *>> LineAndSectionEntry;
LineAndSectionEntry.reserve(Sections.size());
More information about the cfe-commits
mailing list