Home | History | Annotate | Download | only in Sema

Lines Matching defs:Cand

1171     for (OverloadCandidateSet::iterator Cand = Conversions.begin();
1172 Cand != Conversions.end(); ++Cand)
1173 if (Cand->Viable)
1174 ICS.Ambiguous.addConversion(Cand->Function);
4130 for (OverloadCandidateSet::iterator Cand = CandidateSet.begin();
4131 Cand != CandidateSet.end(); ++Cand)
4132 if (Cand->Viable)
4133 ICS.Ambiguous.addConversion(Cand->Function);
7759 for (OverloadCandidateSet::iterator Cand = CandidateSet.begin(),
7761 Cand != CandEnd; ++Cand)
7762 if (Cand->Function) {
7763 Fns.erase(Cand->Function);
7764 if (FunctionTemplateDecl *FunTmpl = Cand->Function->getPrimaryTemplate())
7917 for (iterator Cand = begin(); Cand != end(); ++Cand) {
7918 if (Cand->Viable)
7919 if (Best == end() || isBetterOverloadCandidate(S, *Cand, *Best, Loc,
7921 Best = Cand;
7930 for (iterator Cand = begin(); Cand != end(); ++Cand) {
7931 if (Cand->Viable &&
7932 Cand != Best &&
7933 !isBetterOverloadCandidate(S, *Best, *Cand, Loc,
8085 void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand, unsigned I) {
8086 const ImplicitConversionSequence &Conv = Cand->Conversions[I];
8088 assert(Cand->Function && "for now, candidate must be a function");
8089 FunctionDecl *Fn = Cand->Function;
8289 << (unsigned) (Cand->Fix.Kind);
8292 for (std::vector<FixItHint>::iterator HI = Cand->Fix.Hints.begin(),
8293 HE = Cand->Fix.Hints.end(); HI != HE; ++HI)
8300 void DiagnoseArityMismatch(Sema &S, OverloadCandidate *Cand,
8304 FunctionDecl *Fn = Cand->Function;
8321 assert((Cand->FailureKind == ovl_fail_too_few_arguments) ||
8322 (Cand->FailureKind == ovl_fail_bad_deduction &&
8323 Cand->DeductionFailure.Result == Sema::TDK_TooFewArguments));
8331 assert((Cand->FailureKind == ovl_fail_too_many_arguments) ||
8332 (Cand->FailureKind == ovl_fail_bad_deduction &&
8333 Cand->DeductionFailure.Result == Sema::TDK_TooManyArguments));
8356 void DiagnoseBadDeduction(Sema &S, OverloadCandidate *Cand,
8358 FunctionDecl *Fn = Cand->Function; // pattern
8360 TemplateParameter Param = Cand->DeductionFailure.getTemplateParameter();
8365 switch (Cand->DeductionFailure.Result) {
8381 QualType Param = Cand->DeductionFailure.getFirstArg()->getAsType();
8394 QualType Arg = Cand->DeductionFailure.getSecondArg()->getAsType();
8415 << *Cand->DeductionFailure.getFirstArg()
8416 << *Cand->DeductionFailure.getSecondArg();
8445 DiagnoseArityMismatch(S, Cand, NumArgs);
8457 Cand->DeductionFailure.getTemplateArgumentList()) {
8464 PartialDiagnosticAt *PDiag = Cand->DeductionFailure.getSFINAEDiagnostic();
8493 OverloadExpr::find(Cand->DeductionFailure.getExpr());
8503 << *Cand->DeductionFailure.getFirstArg()
8504 << *Cand->DeductionFailure.getSecondArg();
8517 void DiagnoseBadTarget(Sema &S, OverloadCandidate *Cand) {
8519 FunctionDecl *Callee = Cand->Function;
8544 void NoteFunctionCandidate(Sema &S, OverloadCandidate *Cand,
8546 FunctionDecl *Fn = Cand->Function;
8549 if (Cand->Viable && (Fn->isDeleted() ||
8562 if (Cand->Viable) {
8567 switch (Cand->FailureKind) {
8570 return DiagnoseArityMismatch(S, Cand, NumArgs);
8573 return DiagnoseBadDeduction(S, Cand, NumArgs);
8581 unsigned I = (Cand->IgnoreObjectArgument ? 1 : 0);
8582 for (unsigned N = Cand->NumConversions; I != N; ++I)
8583 if (Cand->Conversions[I].isBad())
8584 return DiagnoseBadConversion(S, Cand, I);
8593 return DiagnoseBadTarget(S, Cand);
8597 void NoteSurrogateCandidate(Sema &S, OverloadCandidate *Cand) {
8601 QualType FnType = Cand->Surrogate->getConversionType();
8625 S.Diag(Cand->Surrogate->getLocation(), diag::note_ovl_surrogate_cand)
8627 MaybeEmitInheritedConstructorNote(S, Cand->Surrogate);
8633 OverloadCandidate *Cand) {
8634 assert(Cand->NumConversions <= 2 && "builtin operator is not binary");
8638 TypeStr += Cand->BuiltinTypes.ParamTypes[0].getAsString();
8639 if (Cand->NumConversions == 1) {
8644 TypeStr += Cand->BuiltinTypes.ParamTypes[1].getAsString();
8651 OverloadCandidate *Cand) {
8652 unsigned NoOperands = Cand->NumConversions;
8654 const ImplicitConversionSequence &ICS = Cand->Conversions[ArgIdx];
8663 SourceLocation GetLocationForCandidate(const OverloadCandidate *Cand) {
8664 if (Cand->Function)
8665 return Cand->Function->getLocation();
8666 if (Cand->IsSurrogate)
8667 return Cand->Surrogate->getLocation();
8811 void CompleteNonViableCandidate(Sema &S, OverloadCandidate *Cand,
8813 assert(!Cand->Viable);
8816 if (Cand->FailureKind != ovl_fail_bad_conversion) return;
8821 Cand->Fix.setConversionChecker(TryCopyInitialization);
8824 unsigned ConvIdx = (Cand->IgnoreObjectArgument ? 1 : 0);
8825 unsigned ConvCount = Cand->NumConversions;
8829 if (Cand->Conversions[ConvIdx - 1].isBad()) {
8830 Unfixable = !Cand->TryToFixBadConversion(ConvIdx - 1, S);
8838 assert(!Cand->Conversions[ConvIdx].isInitialized() &&
8848 if (Cand->IsSurrogate) {
8850 = Cand->Surrogate->getConversionType().getNonReferenceType();
8855 } else if (Cand->Function) {
8856 Proto = Cand->Function->getType()->getAs<FunctionProtoType>();
8857 if (isa<CXXMethodDecl>(Cand->Function) &&
8858 !isa<CXXConstructorDecl>(Cand->Function))
8864 Cand->Conversions[ConvIdx]
8866 Cand->BuiltinTypes.ParamTypes[ConvIdx],
8878 Cand->Conversions[ConvIdx]
8885 if (!Unfixable && Cand->Conversions[ConvIdx].isBad())
8886 Unfixable = !Cand->TryToFixBadConversion(ConvIdx, S);
8889 Cand->Conversions[ConvIdx].setEllipsis();
8907 for (iterator Cand = begin(), LastCand = end(); Cand != LastCand; ++Cand) {
8908 if (Cand->Viable)
8909 Cands.push_back(Cand);
8911 CompleteNonViableCandidate(S, Cand, Args);
8912 if (Cand->Function || Cand->IsSurrogate)
8913 Cands.push_back(Cand);
8928 OverloadCandidate *Cand = *I;
8938 if (Cand->Function)
8939 NoteFunctionCandidate(S, Cand, Args.size());
8940 else if (Cand->IsSurrogate)
8941 NoteSurrogateCandidate(S, Cand);
8943 assert(Cand->Viable &&
8952 NoteAmbiguousUserConversions(S, OpLoc, Cand);
8957 NoteBuiltinOperatorCandidate(S, Opc, OpLoc, Cand);