Lines Matching defs:Cand
1723 for (OverloadCandidateSet::iterator Cand = Conversions.begin();
1724 Cand != Conversions.end(); ++Cand)
1725 if (Cand->Best)
1726 ICS.Ambiguous.addConversion(Cand->FoundDecl, Cand->Function);
5136 for (OverloadCandidateSet::iterator Cand = CandidateSet.begin();
5137 Cand != CandidateSet.end(); ++Cand)
5138 if (Cand->Best)
5139 ICS.Ambiguous.addConversion(Cand->FoundDecl, Cand->Function);
10157 for (OverloadCandidateSet::iterator Cand = CandidateSet.begin(),
10159 Cand != CandEnd; ++Cand)
10160 if (Cand->Function) {
10161 FunctionDecl *Fn = Cand->Function;
10865 [](OverloadCandidate &Cand) { return &Cand; });
10881 llvm::any_of(Candidates, [&](OverloadCandidate *Cand) {
10883 return Cand->Viable && Cand->Function &&
10884 S.CUDA().IdentifyPreference(Caller, Cand->Function) ==
10888 auto IsWrongSideCandidate = [&](OverloadCandidate *Cand) {
10890 return Cand->Viable && Cand->Function &&
10891 S.CUDA().IdentifyPreference(Caller, Cand->Function) ==
10900 for (auto *Cand : Candidates) {
10901 Cand->Best = false;
10902 if (Cand->Viable) {
10904 isBetterOverloadCandidate(S, *Cand, *Best, Loc, Kind))
10905 Best = Cand;
10906 } else if (Cand->NotValidBecauseConstraintExprHasError()) {
10930 for (auto *Cand : Candidates) {
10931 if (Cand->Viable && !Cand->Best &&
10932 !isBetterOverloadCandidate(S, *Curr, *Cand, Loc, Kind)) {
10933 PendingBest.push_back(Cand);
10934 Cand->Best = true;
10936 if (S.isEquivalentInternalLinkageDeclaration(Cand->Function,
10938 EquivalentCands.push_back(Cand->Function);
11305 static void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand,
11307 const ImplicitConversionSequence &Conv = Cand->Conversions[I];
11309 assert(Cand->Function && "for now, candidate must be a function");
11310 FunctionDecl *Fn = Cand->Function;
11325 ClassifyOverloadCandidate(S, Cand->FoundDecl, Fn, Cand->getRewriteKind(),
11352 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11386 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11395 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11404 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11420 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11431 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11445 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11460 << (unsigned)(Cand->Fix.Kind);
11462 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11503 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11516 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11528 << (unsigned)(Cand->Fix.Kind);
11533 for (const FixItHint &HI : Cand->Fix.Hints)
11539 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
11545 static bool CheckArityMismatch(Sema &S, OverloadCandidate *Cand,
11547 assert(Cand->Function && "Candidate is required to be a function.");
11548 FunctionDecl *Fn = Cand->Function;
11562 assert((Cand->FailureKind == ovl_fail_too_few_arguments) ||
11563 (Cand->FailureKind == ovl_fail_bad_deduction &&
11564 Cand->DeductionFailure.getResult() ==
11567 assert((Cand->FailureKind == ovl_fail_too_many_arguments) ||
11568 (Cand->FailureKind == ovl_fail_bad_deduction &&
11569 Cand->DeductionFailure.getResult() ==
11636 static void DiagnoseArityMismatch(Sema &S, OverloadCandidate *Cand,
11638 assert(Cand->Function && "Candidate must be a function");
11639 FunctionDecl *Fn = Cand->Function;
11640 if (!CheckArityMismatch(S, Cand, NumFormalArgs, Cand->TookAddressOfOverload))
11641 DiagnoseArityMismatch(S, Cand->FoundDecl, Fn, NumFormalArgs,
11642 Cand->TookAddressOfOverload);
11938 static void DiagnoseBadDeduction(Sema &S, OverloadCandidate *Cand,
11941 assert(Cand->Function && "Candidate must be a function");
11942 FunctionDecl *Fn = Cand->Function;
11943 TemplateDeductionResult TDK = Cand->DeductionFailure.getResult();
11946 if (CheckArityMismatch(S, Cand, NumArgs))
11949 DiagnoseBadDeduction(S, Cand->FoundDecl, Fn, // pattern
11950 Cand->DeductionFailure, NumArgs, TakingCandidateAddress);
11954 static void DiagnoseBadTarget(Sema &S, OverloadCandidate *Cand) {
11956 assert(Cand->Function && "Candidate must be a Function.");
11957 FunctionDecl *Callee = Cand->Function;
11964 ClassifyOverloadCandidate(S, Cand->FoundDecl, Callee,
11965 Cand->getRewriteKind(), FnDesc);
12013 static void DiagnoseFailedEnableIfAttr(Sema &S, OverloadCandidate *Cand) {
12014 assert(Cand->Function && "Candidate must be a function");
12015 FunctionDecl *Callee = Cand->Function;
12016 EnableIfAttr *Attr = static_cast<EnableIfAttr*>(Cand->DeductionFailure.Data);
12023 static void DiagnoseFailedExplicitSpec(Sema &S, OverloadCandidate *Cand) {
12024 assert(Cand->Function && "Candidate must be a function");
12025 FunctionDecl *Fn = Cand->Function;
12113 static void NoteFunctionCandidate(Sema &S, OverloadCandidate *Cand,
12117 assert(Cand->Function && "Candidate must be a function");
12118 FunctionDecl *Fn = Cand->Function;
12126 Cand->FailureKind != ovl_fail_bad_conversion)
12131 if (Cand->TookAddressOfOverload &&
12136 if (Cand->Viable) {
12140 ClassifyOverloadCandidate(S, Cand->FoundDecl, Fn,
12141 Cand->getRewriteKind(), FnDesc);
12146 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
12151 S.NoteOverloadCandidate(Cand->FoundDecl, Fn, Cand->getRewriteKind());
12166 switch (Cand->FailureKind) {
12169 return DiagnoseArityMismatch(S, Cand, NumArgs);
12172 return DiagnoseBadDeduction(S, Cand, NumArgs,
12178 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
12188 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
12195 return S.NoteOverloadCandidate(Cand->FoundDecl, Fn, Cand->getRewriteKind());
12198 unsigned I = (Cand->IgnoreObjectArgument ? 1 : 0);
12199 for (unsigned N = Cand->Conversions.size(); I != N; ++I)
12200 if (Cand->Conversions[I].isInitialized() && Cand->Conversions[I].isBad())
12201 return DiagnoseBadConversion(S, Cand, I, TakingCandidateAddress);
12206 return S.NoteOverloadCandidate(Cand->FoundDecl, Fn, Cand->getRewriteKind());
12210 return DiagnoseBadTarget(S, Cand);
12213 return DiagnoseFailedEnableIfAttr(S, Cand);
12216 return DiagnoseFailedExplicitSpec(S, Cand);
12226 MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);
12242 ClassifyOverloadCandidate(S, Cand->FoundDecl, Fn,
12243 Cand->getRewriteKind(), FnDesc);
12257 static void NoteSurrogateCandidate(Sema &S, OverloadCandidate *Cand) {
12258 if (shouldSkipNotingLambdaConversionDecl(Cand->Surrogate))
12264 QualType FnType = Cand->Surrogate->getConversionType();
12288 if (!Cand->Viable &&
12289 Cand->FailureKind == ovl_fail_constraints_not_satisfied) {
12290 S.Diag(Cand->Surrogate->getLocation(),
12292 << Cand->Surrogate;
12294 if (S.CheckFunctionConstraints(Cand->Surrogate, Satisfaction))
12297 S.Diag(Cand->Surrogate->getLocation(), diag::note_ovl_surrogate_cand)
12304 OverloadCandidate *Cand) {
12305 assert(Cand->Conversions.size() <= 2 && "builtin operator is not binary");
12309 TypeStr += Cand->BuiltinParamTypes[0].getAsString();
12310 if (Cand->Conversions.size() == 1) {
12315 TypeStr += Cand->BuiltinParamTypes[1].getAsString();
12322 OverloadCandidate *Cand) {
12323 for (const ImplicitConversionSequence &ICS : Cand->Conversions) {
12332 static SourceLocation GetLocationForCandidate(const OverloadCandidate *Cand) {
12333 if (Cand->Function)
12334 return Cand->Function->getLocation();
12335 if (Cand->IsSurrogate)
12336 return Cand->Surrogate->getLocation();
12565 CompleteNonViableCandidate(Sema &S, OverloadCandidate *Cand,
12568 assert(!Cand->Viable);
12571 if (Cand->FailureKind != ovl_fail_bad_conversion)
12577 Cand->Fix.setConversionChecker(TryCopyInitialization);
12580 unsigned ConvCount = Cand->Conversions.size();
12581 for (unsigned ConvIdx = (Cand->IgnoreObjectArgument ? 1 : 0); /**/;
12584 if (Cand->Conversions[ConvIdx].isInitialized() &&
12585 Cand->Conversions[ConvIdx].isBad()) {
12586 Unfixable = !Cand->TryToFixBadConversion(ConvIdx, S);
12598 bool Reversed = Cand->isReversed();
12600 if (Cand->IsSurrogate) {
12602 = Cand->Surrogate->getConversionType().getNonReferenceType();
12608 } else if (Cand->Function) {
12610 Cand->Function->getType()->castAs<FunctionProtoType>()->getParamTypes();
12611 if (isa<CXXMethodDecl>(Cand->Function) &&
12612 !isa<CXXConstructorDecl>(Cand->Function) && !Reversed) {
12616 Cand->Function->getDeclName().getCXXOverloadedOperator() != OO_Call &&
12617 Cand->Function->getDeclName().getCXXOverloadedOperator() !=
12625 ParamTypes = Cand->BuiltinParamTypes;
12633 if (Cand->Conversions[ConvIdx].isInitialized()) {
12637 Cand->Conversions[ConvIdx].setAsIdentityConversion(
12640 Cand->Conversions[ConvIdx] =
12647 if (!Unfixable && Cand->Conversions[ConvIdx].isBad())
12648 Unfixable = !Cand->TryToFixBadConversion(ConvIdx, S);
12651 Cand->Conversions[ConvIdx].setEllipsis();
12663 for (iterator Cand = begin(), LastCand = end(); Cand != LastCand; ++Cand) {
12664 if (!Filter(*Cand))
12668 if (!Cand->Viable) {
12669 if (!Cand->Function && !Cand->IsSurrogate) {
12674 CompleteNonViableCandidate(S, Cand, Args, Kind);
12679 if (!Cand->Viable)
12684 if (!Cand->Best)
12689 Cands.push_back(Cand);
12705 CompleteCandidates(S, OCD_AllCandidates, Args, OpLoc, [](auto &Cand) {
12706 return (Cand.Viable == false &&
12707 Cand.FailureKind == ovl_fail_bad_target) ||
12708 (Cand.Function &&
12709 Cand.Function->template hasAttr<CUDAHostAttr>() &&
12710 Cand.Function->template hasAttr<CUDADeviceAttr>());
12752 OverloadCandidate *Cand = *I;
12760 if (Cand->Function)
12761 NoteFunctionCandidate(S, Cand, Args.size(),
12763 else if (Cand->IsSurrogate)
12764 NoteSurrogateCandidate(S, Cand);
12766 assert(Cand->Viable &&
12775 NoteAmbiguousUserConversions(S, OpLoc, Cand);
12780 NoteBuiltinOperatorCandidate(S, Opc, OpLoc, Cand);
12795 GetLocationForCandidate(const TemplateSpecCandidate *Cand) {
12796 return Cand->Specialization ? Cand->Specialization->getLocation()
12857 /// OCD == OCD_AllCandidates and Cand->Viable == false.
12864 for (iterator Cand = begin(), LastCand = end(); Cand != LastCand; ++Cand) {
12865 if (Cand->Specialization)
12866 Cands.push_back(Cand);
12880 TemplateSpecCandidate *Cand = *I;
12889 assert(Cand->Specialization &&
12891 Cand->NoteDeductionFailure(S, ForTakingAddress);
14760 for (OverloadCandidate &Cand : CandidateSet) {
14761 if (Cand.Viable && Cand.Function && Cand.isReversed() &&
14762 allowAmbiguity(Context, Cand.Function, FnDecl)) {
14765 *this, OpLoc, Cand.Conversions[ArgIdx],
14768 AmbiguousWith.push_back(Cand.Function);