[clang] [clang] Use a range-based for loop (NFC) (PR #144252)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 15 00:49:02 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/144252
Note that LLVM Coding Standards discourages for_each.
>From 47aa7c01c12cf63356eeae4034c89b2174f5f06e Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 15 Jun 2025 00:39:27 -0700
Subject: [PATCH] [clang] Use a range-based for loop (NFC)
Note that LLVM Coding Standards discourages for_each.
---
clang/lib/Sema/SemaOverload.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 49e5a311e239e..8c5f81f126c7a 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -9272,11 +9272,10 @@ class BuiltinOperatorOverloadBuilder {
/// the candidates into a unique set, then move from that set into the list
/// of arithmetic types.
llvm::SmallSetVector<CanQualType, 2> BitIntCandidates;
- llvm::for_each(CandidateTypes, [&BitIntCandidates](
- BuiltinCandidateTypeSet &Candidate) {
+ for (BuiltinCandidateTypeSet &Candidate : CandidateTypes) {
for (QualType BitTy : Candidate.bitint_types())
BitIntCandidates.insert(CanQualType::CreateUnsafe(BitTy));
- });
+ }
llvm::move(BitIntCandidates, std::back_inserter(ArithmeticTypes));
LastPromotedIntegralType = ArithmeticTypes.size();
LastPromotedArithmeticType = ArithmeticTypes.size();
More information about the cfe-commits
mailing list