clang
15.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 } |
using | iterator = SmallVectorImpl< OverloadCandidate >::iterator |
Public Member Functions | |
OverloadCandidateSet (SourceLocation Loc, CandidateSetKind CSK, OperatorRewriteInfo RewriteInfo={}) | |
OverloadCandidateSet (const OverloadCandidateSet &)=delete | |
OverloadCandidateSet & | operator= (const OverloadCandidateSet &)=delete |
~OverloadCandidateSet () | |
SourceLocation | getLocation () const |
CandidateSetKind | getKind () const |
OperatorRewriteInfo | getRewriteInfo () const |
bool | shouldDeferDiags (Sema &S, ArrayRef< Expr * > Args, SourceLocation OpLoc) |
Whether diagnostics should be deferred. More... | |
bool | isNewCandidate (Decl *F, OverloadCandidateParamOrder PO=OverloadCandidateParamOrder::Normal) |
Determine when this overload candidate will be new to the overload set. More... | |
void | exclude (Decl *F) |
Exclude a function from being considered by overload resolution. 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 935 of file Overload.h.
Definition at line 1103 of file Overload.h.
Definition at line 937 of file Overload.h.
|
inline |
Definition at line 1071 of file Overload.h.
|
delete |
|
inline |
Definition at line 1076 of file Overload.h.
|
inline |
Add a new candidate with NumConversions conversion sequence slots to the overload set.
Definition at line 1127 of file Overload.h.
References allocateConversionSequences().
Referenced by clang::Sema::AddBuiltinCandidate().
|
inline |
Allocate storage for conversion sequences for NumConversions conversions.
Definition at line 1114 of file Overload.h.
Referenced by addCandidate(), and clang::Sema::CheckNonDependentConversions().
|
inline |
Definition at line 1105 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 10047 of file SemaOverload.cpp.
Referenced by clang::Sema::BuildLiteralOperatorCall(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), DiagnoseTwoPhaseLookup(), and FindConditionalOverload().
void OverloadCandidateSet::clear | ( | CandidateSetKind | CSK | ) |
Clear out all of the candidates.
Definition at line 915 of file SemaOverload.cpp.
Referenced by clang::Sema::DeduceTemplateSpecializationFromInitializer().
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 11685 of file SemaOverload.cpp.
Referenced by clang::Sema::CreateOverloadedBinOp(), and clang::Sema::DiagnoseMultipleUserDefinedConversion().
|
inline |
Definition at line 1109 of file Overload.h.
Referenced by clang::Sema::CreateOverloadedArraySubscriptExpr(), and clang::Sema::DiagnoseMultipleUserDefinedConversion().
|
inline |
Definition at line 1106 of file Overload.h.
Referenced by chooseRecoveryType(), and clang::Sema::PerformCopyInitialization().
|
inline |
Exclude a function from being considered by overload resolution.
Definition at line 1095 of file Overload.h.
References isNewCandidate(), clang::Normal, and clang::Reversed.
Referenced by clang::Sema::CreateOverloadedBinOp().
|
inline |
Definition at line 1162 of file Overload.h.
|
inline |
Definition at line 1079 of file Overload.h.
|
inline |
Definition at line 1078 of file Overload.h.
Referenced by clang::Sema::CheckNonDependentConversions(), and clang::Sema::LookupOverloadedBinOp().
|
inline |
Definition at line 1080 of file Overload.h.
Referenced by clang::Sema::AddNonMemberOperatorCandidates(), clang::Sema::CreateOverloadedBinOp(), and clang::Sema::LookupOverloadedBinOp().
|
inline |
Determine when this overload candidate will be new to the overload set.
Definition at line 1087 of file Overload.h.
References clang::Decl::getCanonicalDecl().
Referenced by exclude().
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 11749 of file SemaOverload.cpp.
Referenced by clang::Sema::BuildLiteralOperatorCall(), BuildNonArrayForRange(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), and clang::Sema::DiagnoseMultipleUserDefinedConversion().
void OverloadCandidateSet::NoteCandidates | ( | Sema & | S, |
ArrayRef< Expr * > | Args, | ||
ArrayRef< OverloadCandidate * > | Cands, | ||
StringRef | Opc = "" , |
||
SourceLocation | OpLoc = SourceLocation() |
||
) |
Definition at line 11764 of file SemaOverload.cpp.
|
delete |
|
inline |
Definition at line 1164 of file Overload.h.
References CSK_InitByConstructor, and CSK_InitByUserDefinedConversion.
bool OverloadCandidateSet::shouldDeferDiags | ( | Sema & | S, |
ArrayRef< Expr * > | Args, | ||
SourceLocation | OpLoc | ||
) |
Whether diagnostics should be deferred.
Definition at line 11728 of file SemaOverload.cpp.
Referenced by clang::Sema::CreateOverloadedBinOp().
|
inline |
Definition at line 1108 of file Overload.h.
Referenced by clang::Sema::BuildLiteralOperatorCall(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), and clang::Sema::CreateOverloadedUnaryOp().