Lines Matching refs:Cand
1066 for (OverloadCandidateSet::iterator Cand = Conversions.begin();
1067 Cand != Conversions.end(); ++Cand)
1068 if (Cand->Viable)
1069 ICS.Ambiguous.addConversion(Cand->Function);
4010 for (OverloadCandidateSet::iterator Cand = CandidateSet.begin();
4011 Cand != CandidateSet.end(); ++Cand)
4012 if (Cand->Viable)
4013 ICS.Ambiguous.addConversion(Cand->Function);
7563 for (OverloadCandidateSet::iterator Cand = CandidateSet.begin(),
7565 Cand != CandEnd; ++Cand)
7566 if (Cand->Function) {
7567 Fns.erase(Cand->Function);
7568 if (FunctionTemplateDecl *FunTmpl = Cand->Function->getPrimaryTemplate())
7723 for (iterator Cand = begin(); Cand != end(); ++Cand) {
7724 if (Cand->Viable)
7725 if (Best == end() || isBetterOverloadCandidate(S, *Cand, *Best, Loc,
7727 Best = Cand;
7736 for (iterator Cand = begin(); Cand != end(); ++Cand) {
7737 if (Cand->Viable &&
7738 Cand != Best &&
7739 !isBetterOverloadCandidate(S, *Best, *Cand, Loc,
7881 void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand, unsigned I) {
7882 const ImplicitConversionSequence &Conv = Cand->Conversions[I];
7884 assert(Cand->Function && "for now, candidate must be a function");
7885 FunctionDecl *Fn = Cand->Function;
8075 << (unsigned) (Cand->Fix.Kind);
8078 for (std::vector<FixItHint>::iterator HI = Cand->Fix.Hints.begin(),
8079 HE = Cand->Fix.Hints.end(); HI != HE; ++HI)
8086 void DiagnoseArityMismatch(Sema &S, OverloadCandidate *Cand,
8090 FunctionDecl *Fn = Cand->Function;
8107 assert((Cand->FailureKind == ovl_fail_too_few_arguments) ||
8108 (Cand->FailureKind == ovl_fail_bad_deduction &&
8109 Cand->DeductionFailure.Result == Sema::TDK_TooFewArguments));
8117 assert((Cand->FailureKind == ovl_fail_too_many_arguments) ||
8118 (Cand->FailureKind == ovl_fail_bad_deduction &&
8119 Cand->DeductionFailure.Result == Sema::TDK_TooManyArguments));
8137 void DiagnoseBadDeduction(Sema &S, OverloadCandidate *Cand,
8139 FunctionDecl *Fn = Cand->Function; // pattern
8141 TemplateParameter Param = Cand->DeductionFailure.getTemplateParameter();
8146 switch (Cand->DeductionFailure.Result) {
8162 QualType Param = Cand->DeductionFailure.getFirstArg()->getAsType();
8175 QualType Arg = Cand->DeductionFailure.getSecondArg()->getAsType();
8196 << *Cand->DeductionFailure.getFirstArg()
8197 << *Cand->DeductionFailure.getSecondArg();
8226 DiagnoseArityMismatch(S, Cand, NumArgs);
8237 = Cand->DeductionFailure.getTemplateArgumentList())
8258 void DiagnoseBadTarget(Sema &S, OverloadCandidate *Cand) {
8260 FunctionDecl *Callee = Cand->Function;
8285 void NoteFunctionCandidate(Sema &S, OverloadCandidate *Cand,
8287 FunctionDecl *Fn = Cand->Function;
8290 if (Cand->Viable && (Fn->isDeleted() ||
8303 if (Cand->Viable) {
8308 switch (Cand->FailureKind) {
8311 return DiagnoseArityMismatch(S, Cand, NumArgs);
8314 return DiagnoseBadDeduction(S, Cand, NumArgs);
8322 unsigned I = (Cand->IgnoreObjectArgument ? 1 : 0);
8323 for (unsigned N = Cand->NumConversions; I != N; ++I)
8324 if (Cand->Conversions[I].isBad())
8325 return DiagnoseBadConversion(S, Cand, I);
8334 return DiagnoseBadTarget(S, Cand);
8338 void NoteSurrogateCandidate(Sema &S, OverloadCandidate *Cand) {
8342 QualType FnType = Cand->Surrogate->getConversionType();
8366 S.Diag(Cand->Surrogate->getLocation(), diag::note_ovl_surrogate_cand)
8368 MaybeEmitInheritedConstructorNote(S, Cand->Surrogate);
8374 OverloadCandidate *Cand) {
8375 assert(Cand->NumConversions <= 2 && "builtin operator is not binary");
8379 TypeStr += Cand->BuiltinTypes.ParamTypes[0].getAsString();
8380 if (Cand->NumConversions == 1) {
8385 TypeStr += Cand->BuiltinTypes.ParamTypes[1].getAsString();
8392 OverloadCandidate *Cand) {
8393 unsigned NoOperands = Cand->NumConversions;
8395 Cand->Conversions[ArgIdx];
8404 SourceLocation GetLocationForCandidate(const OverloadCandidate *Cand) {
8405 if (Cand->Function)
8406 return Cand->Function->getLocation();
8407 if (Cand->IsSurrogate)
8408 return Cand->Surrogate->getLocation();
8550 void CompleteNonViableCandidate(Sema &S, OverloadCandidate *Cand,
8552 assert(!Cand->Viable);
8555 if (Cand->FailureKind != ovl_fail_bad_conversion) return;
8560 Cand->Fix.setConversionChecker(TryCopyInitialization);
8563 unsigned ConvIdx = (Cand->IgnoreObjectArgument ? 1 : 0);
8564 unsigned ConvCount = Cand->NumConversions;
8568 if (Cand->Conversions[ConvIdx - 1].isBad()) {
8569 Unfixable = !Cand->TryToFixBadConversion(ConvIdx - 1, S);
8577 assert(!Cand->Conversions[ConvIdx].isInitialized() &&
8587 if (Cand->IsSurrogate) {
8589 = Cand->Surrogate->getConversionType().getNonReferenceType();
8594 } else if (Cand->Function) {
8595 Proto = Cand->Function->getType()->getAs<FunctionProtoType>();
8596 if (isa<CXXMethodDecl>(Cand->Function) &&
8597 !isa<CXXConstructorDecl>(Cand->Function))
8603 Cand->Conversions[ConvIdx]
8605 Cand->BuiltinTypes.ParamTypes[ConvIdx],
8617 Cand->Conversions[ConvIdx]
8624 if (!Unfixable && Cand->Conversions[ConvIdx].isBad())
8625 Unfixable = !Cand->TryToFixBadConversion(ConvIdx, S);
8628 Cand->Conversions[ConvIdx].setEllipsis();
8646 for (iterator Cand = begin(), LastCand = end(); Cand != LastCand; ++Cand) {
8647 if (Cand->Viable)
8648 Cands.push_back(Cand);
8650 CompleteNonViableCandidate(S, Cand, Args);
8651 if (Cand->Function || Cand->IsSurrogate)
8652 Cands.push_back(Cand);
8668 OverloadCandidate *Cand = *I;
8678 if (Cand->Function)
8679 NoteFunctionCandidate(S, Cand, Args.size());
8680 else if (Cand->IsSurrogate)
8681 NoteSurrogateCandidate(S, Cand);
8683 assert(Cand->Viable &&
8692 NoteAmbiguousUserConversions(S, OpLoc, Cand);
8697 NoteBuiltinOperatorCandidate(S, Opc, OpLoc, Cand);