clang
9.0.0
|
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13.3). More...
#include "clang/Sema/Overload.h"
Public Types | |
enum | CandidateSetKind { CSK_Normal, CSK_Operator, CSK_InitByUserDefinedConversion, CSK_InitByConstructor } |
using | iterator = SmallVectorImpl< OverloadCandidate >::iterator |
Public Member Functions | |
OverloadCandidateSet (SourceLocation Loc, CandidateSetKind CSK) | |
OverloadCandidateSet (const OverloadCandidateSet &)=delete | |
OverloadCandidateSet & | operator= (const OverloadCandidateSet &)=delete |
~OverloadCandidateSet () | |
SourceLocation | getLocation () const |
CandidateSetKind | getKind () const |
bool | isNewCandidate (Decl *F) |
Determine when this overload candidate will be new to the overload set. More... | |
void | clear (CandidateSetKind CSK) |
Clear out all of the candidates. More... | |
iterator | begin () |
iterator | end () |
size_t | size () const |
bool | empty () const |
ConversionSequenceList | allocateConversionSequences (unsigned NumConversions) |
Allocate storage for conversion sequences for NumConversions conversions. More... | |
OverloadCandidate & | addCandidate (unsigned NumConversions=0, ConversionSequenceList Conversions=None) |
Add a new candidate with NumConversions conversion sequence slots to the overload set. More... | |
OverloadingResult | BestViableFunction (Sema &S, SourceLocation Loc, OverloadCandidateSet::iterator &Best) |
Find the best viable function on this overload set, if it exists. More... | |
SmallVector< OverloadCandidate *, 32 > | CompleteCandidates (Sema &S, OverloadCandidateDisplayKind OCD, ArrayRef< Expr *> Args, SourceLocation OpLoc=SourceLocation(), llvm::function_ref< bool(OverloadCandidate &)> Filter=[](OverloadCandidate &) { return true;}) |
void | 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. More... | |
void | NoteCandidates (Sema &S, ArrayRef< Expr *> Args, ArrayRef< OverloadCandidate *> Cands, StringRef Opc="", SourceLocation OpLoc=SourceLocation()) |
LangAS | getDestAS () |
void | setDestAS (LangAS AS) |
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13.3).
Definition at line 846 of file Overload.h.
Definition at line 936 of file Overload.h.
Definition at line 848 of file Overload.h.
|
inline |
Definition at line 918 of file Overload.h.
|
delete |
|
inline |
Definition at line 922 of file Overload.h.
|
inline |
Add a new candidate with NumConversions conversion sequence slots to the overload set.
Definition at line 960 of file Overload.h.
References clang::C, and clang::OverloadCandidate::Conversions.
Referenced by clang::Sema::AddBuiltinCandidate(), and clang::Sema::AddMethodCandidate().
|
inline |
Allocate storage for conversion sequences for NumConversions conversions.
Definition at line 947 of file Overload.h.
Referenced by clang::Sema::CheckNonDependentConversions().
|
inline |
Definition at line 938 of file Overload.h.
Referenced by IsUserDefinedConversion(), markUnaddressableCandidatesUnviable(), and TryUserDefinedConversion().
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 9411 of file SemaOverload.cpp.
Referenced by clang::Sema::buildOverloadedCallSet(), FindConditionalOverload(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), clang::Sema::PerformContextualImplicitConversion(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().
void OverloadCandidateSet::clear | ( | CandidateSetKind | CSK | ) |
Clear out all of the candidates.
Definition at line 850 of file SemaOverload.cpp.
References clang::Expr::hasPlaceholderType(), i, and clang::Sema::stripARCUnbridgedCast().
Referenced by clang::Sema::BuildForRangeBeginEndCall(), 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 10826 of file SemaOverload.cpp.
|
inline |
Definition at line 942 of file Overload.h.
Referenced by clang::Sema::buildOverloadedCallSet(), FinishOverloadedCallExpr(), and TryReferenceInitializationCore().
|
inline |
Definition at line 939 of file Overload.h.
Referenced by IsUserDefinedConversion(), markUnaddressableCandidatesUnviable(), and TryUserDefinedConversion().
|
inline |
Definition at line 995 of file Overload.h.
|
inline |
Definition at line 925 of file Overload.h.
Referenced by clang::Sema::AddOverloadCandidate(), and mergeCandidatesWithResults().
|
inline |
Definition at line 924 of file Overload.h.
Referenced by clang::Sema::CheckNonDependentConversions().
Determine when this overload candidate will be new to the overload set.
Definition at line 929 of file Overload.h.
References clang::CodeGen::clear(), and clang::Decl::getCanonicalDecl().
Referenced by clang::Sema::AddMethodCandidate(), and clang::Sema::AddOverloadCandidate().
void OverloadCandidateSet::NoteCandidates | ( | PartialDiagnosticAt | PD, |
Sema & | S, | ||
OverloadCandidateDisplayKind | OCD, | ||
ArrayRef< Expr *> | Args, | ||
StringRef | Opc = "" , |
||
SourceLocation | OpLoc = 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 10856 of file SemaOverload.cpp.
References clang::Sema::Diag(), and clang::tooling::Filter.
Referenced by BuildNonArrayForRange(), CheckCXX98CompatAccessibleCopy(), CopyObject(), FinishOverloadedCallExpr(), and resolveAllocationOverload().
void OverloadCandidateSet::NoteCandidates | ( | Sema & | S, |
ArrayRef< Expr *> | Args, | ||
ArrayRef< OverloadCandidate *> | Cands, | ||
StringRef | Opc = "" , |
||
SourceLocation | OpLoc = SourceLocation() |
||
) |
Definition at line 10868 of file SemaOverload.cpp.
References clang::Sema::Diag(), clang::Sema::Diags, clang::OverloadCandidate::Function, clang::DiagnosticsEngine::getShowOverloads(), clang::OverloadCandidate::IsSurrogate, NoteAmbiguousUserConversions(), NoteBuiltinOperatorCandidate(), NoteFunctionCandidate(), NoteSurrogateCandidate(), clang::Ovl_Best, and clang::OverloadCandidate::Viable.
|
delete |
|
inline |
Definition at line 997 of file Overload.h.
References clang::isBetterOverloadCandidate().
Referenced by ResolveConstructorOverload(), and TryUserDefinedConversion().
|
inline |
Definition at line 941 of file Overload.h.
Referenced by CopyObject(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().