clang API Documentation
#include <Overload.h>
Public Types | |
enum | CandidateSetKind { CSK_Normal, CSK_Operator } |
typedef SmallVectorImpl < OverloadCandidate > ::iterator | iterator |
Public Member Functions | |
OverloadCandidateSet (SourceLocation Loc, CandidateSetKind CSK) | |
~OverloadCandidateSet () | |
SourceLocation | getLocation () const |
CandidateSetKind | getKind () const |
bool | isNewCandidate (Decl *F) |
Determine when this overload candidate will be new to the overload set. | |
void | clear () |
Clear out all of the candidates. | |
iterator | begin () |
iterator | end () |
size_t | size () const |
bool | empty () const |
OverloadCandidate & | addCandidate (unsigned NumConversions=0) |
Add a new candidate with NumConversions conversion sequence slots to the overload set. | |
OverloadingResult | BestViableFunction (Sema &S, SourceLocation Loc, OverloadCandidateSet::iterator &Best, bool UserDefinedConversion=false) |
Find the best viable function on this overload set, if it exists. | |
void | NoteCandidates (Sema &S, OverloadCandidateDisplayKind OCD, ArrayRef< Expr * > Args, StringRef Opc="", SourceLocation Loc=SourceLocation()) |
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13.3).
Definition at line 683 of file Overload.h.
typedef SmallVectorImpl<OverloadCandidate>::iterator clang::OverloadCandidateSet::iterator |
Definition at line 732 of file Overload.h.
Definition at line 685 of file Overload.h.
clang::OverloadCandidateSet::OverloadCandidateSet | ( | SourceLocation | Loc, |
CandidateSetKind | CSK | ||
) | [inline] |
Definition at line 716 of file Overload.h.
clang::OverloadCandidateSet::~OverloadCandidateSet | ( | ) | [inline] |
Definition at line 718 of file Overload.h.
OverloadCandidate& clang::OverloadCandidateSet::addCandidate | ( | unsigned | NumConversions = 0 | ) | [inline] |
Add a new candidate with NumConversions conversion sequence slots to the overload set.
Definition at line 741 of file Overload.h.
References AttributeLangSupport::C, clang::OverloadCandidate::Conversions, and clang::OverloadCandidate::NumConversions.
Referenced by clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), and clang::Sema::AddTemplateOverloadCandidate().
iterator clang::OverloadCandidateSet::begin | ( | ) | [inline] |
Definition at line 733 of file Overload.h.
Referenced by clang::Sema::AddArgumentDependentLookupCandidates(), BestViableFunction(), clang::Sema::CodeCompleteCall(), and NoteCandidates().
OverloadingResult OverloadCandidateSet::BestViableFunction | ( | Sema & | S, |
SourceLocation | Loc, | ||
OverloadCandidateSet::iterator & | Best, | ||
bool | UserDefinedConversion = false |
||
) |
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 8417 of file SemaOverload.cpp.
References begin(), end(), clang::isBetterOverloadCandidate(), clang::Sema::isFunctionConsideredUnavailable(), clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, and clang::OR_Success.
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildForRangeBeginEndCall(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildOverloadedCallExpr(), CheckCXX98CompatAccessibleCopy(), CopyObject(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::InitializationSequence::Diagnose(), clang::Sema::FindAllocationOverload(), FindConditionalOverload(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), clang::Sema::PerformContextualImplicitConversion(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), TryTypoCorrectionForCall(), and TryUserDefinedConversion().
void OverloadCandidateSet::clear | ( | ) |
Clear out all of the candidates.
Definition at line 762 of file SemaOverload.cpp.
Referenced by clang::Sema::BuildForRangeBeginEndCall(), IsUserDefinedConversion(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().
bool clang::OverloadCandidateSet::empty | ( | ) | const [inline] |
Definition at line 737 of file Overload.h.
Referenced by clang::Sema::BuildForRangeBeginEndCall(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::buildOverloadedCallSet(), clang::Sema::CodeCompleteCall(), clang::Sema::CreateOverloadedArraySubscriptExpr(), FinishOverloadedCallExpr(), tryDiagnoseOverloadedCast(), and TryReferenceInitializationCore().
iterator clang::OverloadCandidateSet::end | ( | ) | [inline] |
Definition at line 734 of file Overload.h.
Referenced by clang::Sema::AddArgumentDependentLookupCandidates(), BestViableFunction(), clang::Sema::CodeCompleteCall(), and NoteCandidates().
CandidateSetKind clang::OverloadCandidateSet::getKind | ( | ) | const [inline] |
Definition at line 721 of file Overload.h.
Referenced by clang::Sema::AddOverloadCandidate().
SourceLocation clang::OverloadCandidateSet::getLocation | ( | ) | const [inline] |
Definition at line 720 of file Overload.h.
Referenced by clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddTemplateConversionCandidate(), and clang::Sema::AddTemplateOverloadCandidate().
bool clang::OverloadCandidateSet::isNewCandidate | ( | Decl * | F | ) | [inline] |
Determine when this overload candidate will be new to the overload set.
Definition at line 725 of file Overload.h.
References clang::Decl::getCanonicalDecl().
Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), and clang::Sema::AddTemplateOverloadCandidate().
void OverloadCandidateSet::NoteCandidates | ( | Sema & | S, |
OverloadCandidateDisplayKind | OCD, | ||
ArrayRef< Expr * > | Args, | ||
StringRef | Opc = "" , |
||
SourceLocation | OpLoc = SourceLocation() |
||
) |
PrintOverloadCandidates - When overload resolution fails, prints diagnostic messages containing the candidates in the candidate set.
Definition at line 9546 of file SemaOverload.cpp.
References begin(), CompleteNonViableCandidate(), clang::Sema::Diag(), clang::Sema::Diags, end(), clang::OverloadCandidate::Function, clang::DiagnosticsEngine::getShowOverloads(), clang::OverloadCandidate::IsSurrogate, NoteAmbiguousUserConversions(), NoteBuiltinOperatorCandidate(), NoteFunctionCandidate(), NoteSurrogateCandidate(), clang::OCD_AllCandidates, clang::Ovl_Best, size(), and clang::OverloadCandidate::Viable.
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildOverloadedArrowExpr(), CheckCXX98CompatAccessibleCopy(), CopyObject(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::InitializationSequence::Diagnose(), clang::Sema::FindAllocationOverload(), FinishOverloadedCallExpr(), and tryDiagnoseOverloadedCast().
size_t clang::OverloadCandidateSet::size | ( | ) | const [inline] |
Definition at line 736 of file Overload.h.
Referenced by clang::Sema::BuildOverloadedArrowExpr(), CopyObject(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), NoteCandidates(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().