[clang] dd4b69f - [Basic] Use llvm::erase_if (NFC) (#140309)
via cfe-commits
cfe-commits at lists.llvm.org
Fri May 16 15:07:57 PDT 2025
Author: Kazu Hirata
Date: 2025-05-16T15:07:54-07:00
New Revision: dd4b69f9a837048b19346eff2e9f931a51cc91c9
URL: https://github.com/llvm/llvm-project/commit/dd4b69f9a837048b19346eff2e9f931a51cc91c9
DIFF: https://github.com/llvm/llvm-project/commit/dd4b69f9a837048b19346eff2e9f931a51cc91c9.diff
LOG: [Basic] Use llvm::erase_if (NFC) (#140309)
Added:
Modified:
clang/lib/Basic/Diagnostic.cpp
Removed:
################################################################################
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