clang
19.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=std::nullopt) |
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 980 of file Overload.h.
Definition at line 1153 of file Overload.h.
Definition at line 982 of file Overload.h.
|
inline |
Definition at line 1121 of file Overload.h.
|
delete |
|
inline |
Definition at line 1126 of file Overload.h.
|
inline |
Add a new candidate with NumConversions conversion sequence slots to the overload set.
Definition at line 1178 of file Overload.h.
References allocateConversionSequences().
Referenced by clang::Sema::AddBuiltinCandidate().
|
inline |
Allocate storage for conversion sequences for NumConversions conversions.
Definition at line 1164 of file Overload.h.
Referenced by addCandidate(), and clang::Sema::CheckNonDependentConversions().
|
inline |
Definition at line 1155 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 10859 of file SemaOverload.cpp.
Referenced by clang::Sema::BuildLiteralOperatorCall(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), DiagnoseTwoPhaseLookup(), and FindConditionalOverload().
void OverloadCandidateSet::clear | ( | CandidateSetKind | CSK | ) |
Clear out all of the candidates.
Definition at line 1070 of file SemaOverload.cpp.
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 12581 of file SemaOverload.cpp.
Referenced by clang::Sema::CreateOverloadedBinOp(), and clang::Sema::DiagnoseMultipleUserDefinedConversion().
|
inline |
Definition at line 1159 of file Overload.h.
Referenced by clang::Sema::CreateOverloadedArraySubscriptExpr(), and clang::Sema::DiagnoseMultipleUserDefinedConversion().
|
inline |
Definition at line 1156 of file Overload.h.
Referenced by chooseRecoveryType().
|
inline |
Exclude a function from being considered by overload resolution.
Definition at line 1145 of file Overload.h.
References isNewCandidate(), clang::Normal, and clang::Reversed.
Referenced by clang::Sema::CreateOverloadedBinOp().
|
inline |
Definition at line 1213 of file Overload.h.
|
inline |
Definition at line 1129 of file Overload.h.
|
inline |
Definition at line 1128 of file Overload.h.
References Loc.
Referenced by clang::Sema::CheckNonDependentConversions(), and clang::Sema::LookupOverloadedBinOp().
|
inline |
Definition at line 1130 of file Overload.h.
Referenced by clang::Sema::AddMemberOperatorCandidates(), 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 1137 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 12645 of file SemaOverload.cpp.
Referenced by clang::Sema::BuildLiteralOperatorCall(), BuildNonArrayForRange(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), and clang::Sema::DiagnoseMultipleUserDefinedConversion().
void OverloadCandidateSet::NoteCandidates | ( | Sema & | S, |
ArrayRef< Expr * > | Args, | ||
ArrayRef< OverloadCandidate * > | Cands, | ||
StringRef | Opc = "" , |
||
SourceLocation | OpLoc = SourceLocation() |
||
) |
Definition at line 12669 of file SemaOverload.cpp.
|
delete |
|
inline |
Definition at line 1215 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 12624 of file SemaOverload.cpp.
Referenced by clang::Sema::CreateOverloadedBinOp().
|
inline |
Definition at line 1158 of file Overload.h.
Referenced by clang::Sema::BuildLiteralOperatorCall(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), and clang::Sema::CreateOverloadedUnaryOp().