@@ -1108,7 +1108,7 @@ bool OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed(
1108
1108
}
1109
1109
1110
1110
void OverloadCandidateSet::destroyCandidates() {
1111
- for (iterator i = begin(), e = end(); i != e; ++i) {
1111
+ for (iterator i = Candidates. begin(), e = Candidates. end(); i != e; ++i) {
1112
1112
for (auto &C : i->Conversions)
1113
1113
C.~ImplicitConversionSequence();
1114
1114
if (!i->Viable && i->FailureKind == ovl_fail_bad_deduction)
@@ -11237,7 +11237,7 @@ void OverloadCandidateSet::PerfectViableFunction(
11237
11237
Sema &S, SourceLocation Loc, OverloadCandidateSet::iterator &Best) {
11238
11238
11239
11239
Best = end();
11240
- for (auto It = begin(); It != end(); ++It) {
11240
+ for (auto It = Candidates. begin(); It != Candidates. end(); ++It) {
11241
11241
11242
11242
if (!It->isPerfectMatch(S.getASTContext()))
11243
11243
continue;
@@ -11277,7 +11277,8 @@ OverloadingResult OverloadCandidateSet::BestViableFunctionImpl(
11277
11277
11278
11278
llvm::SmallVector<OverloadCandidate *, 16> Candidates;
11279
11279
Candidates.reserve(this->Candidates.size());
11280
- std::transform(begin(), end(), std::back_inserter(Candidates),
11280
+ std::transform(this->Candidates.begin(), this->Candidates.end(),
11281
+ std::back_inserter(Candidates),
11281
11282
[](OverloadCandidate &Cand) { return &Cand; });
11282
11283
11283
11284
if (S.getLangOpts().CUDA)
@@ -13050,7 +13051,8 @@ SmallVector<OverloadCandidate *, 32> OverloadCandidateSet::CompleteCandidates(
13050
13051
// be prohibitive, so we make a set of pointers and sort those.
13051
13052
SmallVector<OverloadCandidate*, 32> Cands;
13052
13053
if (OCD == OCD_AllCandidates) Cands.reserve(size());
13053
- for (iterator Cand = begin(), LastCand = end(); Cand != LastCand; ++Cand) {
13054
+ for (iterator Cand = Candidates.begin(), LastCand = Candidates.end();
13055
+ Cand != LastCand; ++Cand) {
13054
13056
if (!Filter(*Cand))
13055
13057
continue;
13056
13058
switch (OCD) {
@@ -13127,7 +13129,8 @@ void OverloadCandidateSet::NoteCandidates(
13127
13129
NoteCandidates(S, Args, Cands, Opc, OpLoc);
13128
13130
13129
13131
if (OCD == OCD_AmbiguousCandidates)
13130
- MaybeDiagnoseAmbiguousConstraints(S, {begin(), end()});
13132
+ MaybeDiagnoseAmbiguousConstraints(S,
13133
+ {Candidates.begin(), Candidates.end()});
13131
13134
}
13132
13135
13133
13136
void OverloadCandidateSet::NoteCandidates(Sema &S, ArrayRef<Expr *> Args,
@@ -16255,7 +16258,8 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Obj,
16255
16258
// we filter them out to produce better error diagnostics, ie to avoid
16256
16259
// showing 2 failed overloads instead of one.
16257
16260
bool IgnoreSurrogateFunctions = false;
16258
- if (CandidateSet.size() == 1 && Record->getAsCXXRecordDecl()->isLambda()) {
16261
+ if (CandidateSet.nonDeferredCandidatesCount() == 1 &&
16262
+ Record->getAsCXXRecordDecl()->isLambda()) {
16259
16263
const OverloadCandidate &Candidate = *CandidateSet.begin();
16260
16264
if (!Candidate.Viable &&
16261
16265
Candidate.FailureKind == ovl_fail_constraints_not_satisfied)
0 commit comments