[clang] [clang][Sema] Improve `collectViableConversionCandidates` (PR #97908)

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 2 05:41:50 PDT 2024


================
@@ -6504,29 +6504,22 @@ static void
 collectViableConversionCandidates(Sema &SemaRef, Expr *From, QualType ToType,
                                   UnresolvedSetImpl &ViableConversions,
                                   OverloadCandidateSet &CandidateSet) {
-  for (unsigned I = 0, N = ViableConversions.size(); I != N; ++I) {
-    DeclAccessPair FoundDecl = ViableConversions[I];
+  for (DeclAccessPair FoundDecl : ViableConversions.pairs()) {
----------------
cor3ntin wrote:

```suggestion
  for (const DeclAccessPair & FoundDecl : ViableConversions.pairs()) {
```

https://github.com/llvm/llvm-project/pull/97908


More information about the cfe-commits mailing list