|
clang 24.0.0git
|
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13.3). More...
#include "clang/Sema/Overload.h"
Classes | |
| struct | OperatorRewriteInfo |
| Information about operator rewrites to consider when adding operator functions to a candidate set. More... | |
Public Types | |
| enum | CandidateSetKind { CSK_Normal , CSK_Operator , CSK_InitByUserDefinedConversion , CSK_InitByConstructor , CSK_AddressOfOverloadSet , CSK_CodeCompletion } |
| using | iterator = SmallVectorImpl<OverloadCandidate>::iterator |
| using | const_iterator = SmallVectorImpl<OverloadCandidate>::const_iterator |
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13.3).
Definition at line 1161 of file Overload.h.
| using clang::OverloadCandidateSet::const_iterator = SmallVectorImpl<OverloadCandidate>::const_iterator |
Definition at line 1378 of file Overload.h.
| using clang::OverloadCandidateSet::iterator = SmallVectorImpl<OverloadCandidate>::iterator |
Definition at line 1377 of file Overload.h.
Definition at line 1163 of file Overload.h.
|
inline |
Definition at line 1339 of file Overload.h.
Referenced by operator=(), and OverloadCandidateSet().
|
delete |
References OverloadCandidateSet().
|
inline |
Definition at line 1347 of file Overload.h.
|
inline |
Add a new candidate with NumConversions conversion sequence slots to the overload set.
Definition at line 1428 of file Overload.h.
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), AddMethodTemplateCandidateImmediately(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), AddTemplateConversionCandidateImmediately(), and AddTemplateOverloadCandidateImmediately().
| void OverloadCandidateSet::AddDeferredConversionTemplateCandidate | ( | FunctionTemplateDecl * | FunctionTemplate, |
| DeclAccessPair | FoundDecl, | ||
| CXXRecordDecl * | ActingContext, | ||
| Expr * | From, | ||
| QualType | ToType, | ||
| bool | AllowObjCConversionOnExplicit, | ||
| bool | AllowExplicit, | ||
| bool | AllowResultConversion ) |
Definition at line 11507 of file SemaOverload.cpp.
References clang::C, clang::DeferredTemplateOverloadCandidate::Conversion, and clang::FunctionTemplate.
Referenced by clang::Sema::AddTemplateConversionCandidate().
| void OverloadCandidateSet::AddDeferredMethodTemplateCandidate | ( | FunctionTemplateDecl * | MethodTmpl, |
| DeclAccessPair | FoundDecl, | ||
| CXXRecordDecl * | ActingContext, | ||
| QualType | ObjectType, | ||
| Expr::Classification | ObjectClassification, | ||
| ArrayRef< Expr * > | Args, | ||
| bool | SuppressUserConversions, | ||
| bool | PartialOverloading, | ||
| OverloadCandidateParamOrder | PO ) |
Definition at line 11480 of file SemaOverload.cpp.
References clang::C, clang::FunctionTemplateDecl::getTemplatedDecl(), clang::isa(), and clang::DeferredTemplateOverloadCandidate::Method.
Referenced by clang::Sema::AddMethodTemplateCandidate().
| void OverloadCandidateSet::AddDeferredTemplateCandidate | ( | FunctionTemplateDecl * | FunctionTemplate, |
| DeclAccessPair | FoundDecl, | ||
| ArrayRef< Expr * > | Args, | ||
| bool | SuppressUserConversions, | ||
| bool | PartialOverloading, | ||
| bool | AllowExplicit, | ||
| CallExpr::ADLCallKind | IsADLCandidate, | ||
| OverloadCandidateParamOrder | PO, | ||
| bool | AggregateCandidateDeduction ) |
Definition at line 11455 of file SemaOverload.cpp.
References clang::C, clang::DeferredTemplateOverloadCandidate::Function, clang::FunctionTemplate, and clang::isa().
Referenced by clang::Sema::AddTemplateOverloadCandidate().
|
inline |
Allocate storage for conversion sequences for NumConversions conversions.
Definition at line 1397 of file Overload.h.
Referenced by clang::Sema::CheckNonDependentConversions().
|
inline |
Definition at line 1380 of file Overload.h.
Referenced by clang::Sema::AddArgumentDependentLookupCandidates(), clang::Sema::BuildCallToObjectOfClassType(), ComputeSelectedDestructor(), FindConversionForRefInit(), markUnaddressableCandidatesUnviable(), clang::TemplateSpecCandidateSet::NoteCandidates(), and TryUserDefinedConversion().
|
inline |
Definition at line 1383 of file Overload.h.
| OverloadingResult OverloadCandidateSet::BestViableFunction | ( | Sema & | S, |
| SourceLocation | Loc, | ||
| OverloadCandidateSet::iterator & | Best ) |
Find the best viable function on this overload set, if it exists.
Computes the best viable function (C++ 13.3.3) within an overload candidate set.
| Loc | The location of the function name (or operator symbol) for which overload resolution occurs. |
| Best | If overload resolution was successful or found a deleted function, Best points to the candidate function found. |
Definition at line 11641 of file SemaOverload.cpp.
References clang::Sema::Context, end(), InjectNonDeducedTemplateCandidates(), and shouldDeferTemplateArgumentDeduction().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildForRangeBeginEndCall(), clang::Sema::BuildLiteralOperatorCall(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildOverloadedCallExpr(), clang::Sema::buildOverloadedCallSet(), ComputeSelectedDestructor(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), FindConditionalOverload(), FindConversionForRefInit(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), clang::Sema::LookupSpecialMember(), LookupSpecialMemberFromXValue(), clang::Sema::PerformContextualImplicitConversion(), resolveAllocationOverload(), resolveBuiltinNewDeleteOverload(), ResolveConstructorOverload(), TryBuildIterableExpansionStmtInitializer(), tryDiagnoseOverloadedCast(), TryRefInitWithConversionFunction(), TryTypoCorrectionForCall(), and TryUserDefinedConversion().
| void OverloadCandidateSet::clear | ( | CandidateSetKind | CSK | ) |
Clear out all of the candidates.
Definition at line 1171 of file SemaOverload.cpp.
Referenced by clang::Sema::BuildForRangeBeginEndCall(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().
| SmallVector< OverloadCandidate *, 32 > OverloadCandidateSet::CompleteCandidates | ( | Sema & | S, |
| OverloadCandidateDisplayKind | OCD, | ||
| ArrayRef< Expr * > | Args, | ||
| SourceLocation | OpLoc = SourceLocation(), | ||
| llvm::function_ref< bool(OverloadCandidate &)> | Filter = [](OverloadCandidate &) { return true; } ) |
Definition at line 13456 of file SemaOverload.cpp.
References clang::OverloadCandidate::Best, CompleteNonViableCandidate(), clang::OverloadCandidate::Function, InjectNonDeducedTemplateCandidates(), clang::OverloadCandidate::IsSurrogate, clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OCD_ViableCandidates, size(), and clang::OverloadCandidate::Viable.
Referenced by clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), diagnoseNoViableFunctionForAllocationOverloadResolution(), NoteCandidates(), and shouldDeferDiags().
|
inline |
Definition at line 1463 of file Overload.h.
Referenced by clang::Sema::AddTemplateConversionCandidate(), and clang::Sema::AddTemplateOverloadCandidate().
|
inline |
Definition at line 1390 of file Overload.h.
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildForRangeBeginEndCall(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::buildOverloadedCallSet(), BuildRecoveryCallExpr(), ComputeSelectedDestructor(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), clang::SemaCodeCompletion::ProduceCallSignatureHelp(), tryDiagnoseOverloadedCast(), and TryReferenceInitializationCore().
|
inline |
Definition at line 1381 of file Overload.h.
Referenced by clang::Sema::AddArgumentDependentLookupCandidates(), BestViableFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildOverloadedCallExpr(), chooseRecoveryType(), DiagnoseTwoPhaseLookup(), FindConversionForRefInit(), FinishOverloadedCallExpr(), markUnaddressableCandidatesUnviable(), clang::TemplateSpecCandidateSet::NoteCandidates(), and TryUserDefinedConversion().
|
inline |
Definition at line 1384 of file Overload.h.
|
inline |
Exclude a function from being considered by overload resolution.
Definition at line 1369 of file Overload.h.
References isNewCandidate(), clang::Normal, and clang::Reversed.
Referenced by clang::Sema::CreateOverloadedBinOp(), and DiagnoseTwoPhaseLookup().
|
inline |
Definition at line 1489 of file Overload.h.
Referenced by clang::Sema::AddOverloadCandidate().
|
inline |
Definition at line 1350 of file Overload.h.
Referenced by clang::Sema::AddMethodCandidate(), AddMethodTemplateCandidateImmediately(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddTemplateConversionCandidate(), AddTemplateOverloadCandidateImmediately(), clang::Sema::CheckNonDependentConversions(), FinishOverloadedCallExpr(), mergeCandidatesWithResults(), and TryConstructorInitialization().
|
inline |
Definition at line 1349 of file Overload.h.
Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), AddMethodTemplateCandidateImmediately(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), AddTemplateConversionCandidateImmediately(), AddTemplateOverloadCandidateImmediately(), clang::Sema::CheckNonDependentConversions(), clang::Sema::LookupOverloadedBinOp(), and clang::Sema::LookupOverloadedUnaryOp().
|
inline |
Definition at line 1419 of file Overload.h.
References getPersistentArgsArray(), and clang::T.
|
inline |
Provide storage for any Expr* arg that must be preserved until deferred template candidates are deduced.
Typically this should be used for reversed operator arguments and any time the argument array is transformed while adding a template candidate.
Definition at line 1413 of file Overload.h.
Referenced by clang::Sema::AddArgumentDependentLookupCandidates(), clang::Sema::AddNonMemberOperatorCandidates(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), getPersistentArgsArray(), and clang::Sema::LookupOverloadedBinOp().
|
inline |
Definition at line 1351 of file Overload.h.
Referenced by clang::Sema::AddArgumentDependentLookupCandidates(), clang::Sema::AddMemberOperatorCandidates(), clang::Sema::AddMethodCandidate(), AddMethodTemplateCandidateImmediately(), clang::Sema::AddNonMemberOperatorCandidates(), clang::Sema::AddOverloadCandidate(), clang::Sema::CreateOverloadedBinOp(), and clang::Sema::LookupOverloadedBinOp().
| void OverloadCandidateSet::InjectNonDeducedTemplateCandidates | ( | Sema & | S | ) |
Definition at line 11559 of file SemaOverload.cpp.
References AddTemplateOverloadCandidate(), clang::DeferredTemplateOverloadCandidate::Conversion, clang::DeferredTemplateOverloadCandidate::Function, clang::DeferredTemplateOverloadCandidate::Method, and clang::DeferredTemplateOverloadCandidate::Next.
Referenced by BestViableFunction(), and CompleteCandidates().
|
inline |
Determine when this overload candidate will be new to the overload set.
Definition at line 1361 of file Overload.h.
References clang::Decl::getCanonicalDecl(), and clang::Normal.
Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), and exclude().
|
inline |
Definition at line 1388 of file Overload.h.
Referenced by clang::Sema::BuildCallToObjectOfClassType().
| void OverloadCandidateSet::NoteCandidates | ( | PartialDiagnosticAt | PA, |
| Sema & | S, | ||
| OverloadCandidateDisplayKind | OCD, | ||
| ArrayRef< Expr * > | Args, | ||
| StringRef | Opc = "", | ||
| SourceLocation | Loc = SourceLocation(), | ||
| llvm::function_ref< bool(OverloadCandidate &)> | Filter = [](OverloadCandidate &) { return true; } ) |
When overload resolution fails, prints diagnostic messages containing the candidates in the candidate set.
Definition at line 13524 of file SemaOverload.cpp.
References CompleteCandidates(), clang::SemaBase::Diag(), MaybeDiagnoseAmbiguousConstraints(), NoteCandidates(), clang::OCD_AmbiguousCandidates, and shouldDeferDiags().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildCXXForRangeBeginEndVars(), clang::Sema::BuildLiteralOperatorCall(), BuildNonArrayForRange(), clang::Sema::BuildOverloadedArrowExpr(), CheckCXX98CompatAccessibleCopy(), ComputeSelectedDestructor(), CopyObject(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), diagnoseNoViableFunctionForAllocationOverloadResolution(), clang::Sema::DiagnoseUseOfDeletedFunction(), FinishOverloadedCallExpr(), NoteCandidates(), resolveAllocationOverload(), resolveBuiltinNewDeleteOverload(), and tryDiagnoseOverloadedCast().
| void OverloadCandidateSet::NoteCandidates | ( | Sema & | S, |
| ArrayRef< Expr * > | Args, | ||
| ArrayRef< OverloadCandidate * > | Cands, | ||
| StringRef | Opc = "", | ||
| SourceLocation | OpLoc = SourceLocation() ) |
Definition at line 13552 of file SemaOverload.cpp.
References CSK_AddressOfOverloadSet, clang::SemaBase::Diag(), clang::Sema::Diags, clang::OverloadCandidate::Function, clang::DiagnosticsEngine::getNumOverloadCandidatesToShow(), clang::DiagnosticsEngine::getShowOverloads(), int, clang::OverloadCandidate::IsSurrogate, NoteAmbiguousUserConversions(), NoteBuiltinOperatorCandidate(), NoteFunctionCandidate(), NoteSurrogateCandidate(), clang::DiagnosticsEngine::overloadCandidatesShown(), clang::Ovl_Best, shouldDeferDiags(), and clang::OverloadCandidate::Viable.
|
delete |
References OverloadCandidateSet().
|
inline |
Definition at line 1491 of file Overload.h.
References CSK_InitByConstructor, and CSK_InitByUserDefinedConversion.
Referenced by ResolveConstructorOverload(), and TryUserDefinedConversion().
| bool OverloadCandidateSet::shouldDeferDiags | ( | Sema & | S, |
| ArrayRef< Expr * > | Args, | ||
| SourceLocation | OpLoc ) |
Whether diagnostics should be deferred.
Definition at line 13503 of file SemaOverload.cpp.
References CompleteCandidates(), clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::Function, clang::Sema::getLangOpts(), hasAttr(), clang::OCD_AllCandidates, clang::ovl_fail_bad_target, and clang::OverloadCandidate::Viable.
Referenced by clang::Sema::CreateOverloadedBinOp(), NoteCandidates(), and NoteCandidates().
Definition at line 13603 of file SemaOverload.cpp.
References CSK_CodeCompletion, CSK_InitByUserDefinedConversion, clang::Sema::getCurFunctionDecl(), clang::Sema::getLangOpts(), and clang::Decl::hasAttr().
Referenced by clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), and BestViableFunction().
|
inline |
Definition at line 1386 of file Overload.h.
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildLiteralOperatorCall(), clang::Sema::BuildOverloadedArrowExpr(), CompleteCandidates(), CopyObject(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), FindConversionForRefInit(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), clang::TemplateSpecCandidateSet::NoteCandidates(), TryConstructorInitialization(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().