clang 18.0.0git
|
OverloadCandidate - A single candidate in an overload set (C++ 13.3). More...
#include "clang/Sema/Overload.h"
Public Member Functions | |
OverloadCandidateRewriteKind | getRewriteKind () const |
Get RewriteKind value in OverloadCandidateRewriteKind type (This function is to workaround the spurious GCC bitfield enum warning) | |
bool | isReversed () const |
bool | hasAmbiguousConversion () const |
hasAmbiguousConversion - Returns whether this overload candidate requires an ambiguous conversion or not. | |
bool | TryToFixBadConversion (unsigned Idx, Sema &S) |
unsigned | getNumParams () const |
bool | NotValidBecauseConstraintExprHasError () const |
Public Attributes | |
FunctionDecl * | Function |
Function - The actual function that this candidate represents. | |
DeclAccessPair | FoundDecl |
FoundDecl - The original declaration that was looked up / invented / otherwise found, together with its access. | |
QualType | BuiltinParamTypes [3] |
BuiltinParamTypes - Provides the parameter types of a built-in overload candidate. | |
CXXConversionDecl * | Surrogate |
Surrogate - The conversion function for which this candidate is a surrogate, but only if IsSurrogate is true. | |
ConversionSequenceList | Conversions |
The conversion sequences used to convert the function arguments to the function parameters. | |
ConversionFixItGenerator | Fix |
The FixIt hints which can be used to fix the Bad candidate. | |
bool | Viable: 1 |
Viable - True to indicate that this overload candidate is viable. | |
bool | Best: 1 |
Whether this candidate is the best viable function, or tied for being the best viable function. | |
bool | IsSurrogate: 1 |
IsSurrogate - True to indicate that this candidate is a surrogate for a conversion to a function pointer or reference (C++ [over.call.object]). | |
bool | IgnoreObjectArgument: 1 |
IgnoreObjectArgument - True to indicate that the first argument's conversion, which for this function represents the implicit object argument, should be ignored. | |
CallExpr::ADLCallKind | IsADLCandidate: 1 |
True if the candidate was found using ADL. | |
unsigned | RewriteKind: 2 |
Whether this is a rewritten candidate, and if so, of what kind? | |
unsigned char | FailureKind |
FailureKind - The reason why this candidate is not viable. | |
unsigned | ExplicitCallArguments |
The number of call arguments that were explicitly provided, to be used while performing partial ordering of function templates. | |
union { | |
DeductionFailureInfo DeductionFailure | |
StandardConversionSequence FinalConversion | |
FinalConversion - For a conversion function (where Function is a CXXConversionDecl), the standard conversion that occurs after the call to the overload candidate to convert the result of calling the conversion function to the required type. More... | |
}; | |
Friends | |
class | OverloadCandidateSet |
OverloadCandidate - A single candidate in an overload set (C++ 13.3).
Definition at line 826 of file Overload.h.
|
inline |
Definition at line 935 of file Overload.h.
References clang::Type::castAs(), ExplicitCallArguments, Function, clang::CXXConversionDecl::getConversionType(), clang::FunctionDecl::getNumParams(), getNumParams(), clang::Type::getPointeeType(), clang::Type::isPointerType(), clang::Type::isReferenceType(), IsSurrogate, and Surrogate.
Referenced by getNumParams().
|
inline |
Get RewriteKind value in OverloadCandidateRewriteKind type (This function is to workaround the spurious GCC bitfield enum warning)
Definition at line 906 of file Overload.h.
References RewriteKind.
Referenced by DiagnoseBadConversion(), DiagnoseBadTarget(), isReversed(), and NoteFunctionCandidate().
|
inline |
hasAmbiguousConversion - Returns whether this overload candidate requires an ambiguous conversion or not.
Definition at line 914 of file Overload.h.
References clang::C, and Conversions.
|
inline |
Definition at line 910 of file Overload.h.
References clang::CRK_Reversed, and getRewriteKind().
Referenced by CompleteNonViableCandidate(), clang::isBetterOverloadCandidate(), and sameFunctionParameterTypeLists().
bool OverloadCandidate::NotValidBecauseConstraintExprHasError | ( | ) | const |
Definition at line 10579 of file SemaOverload.cpp.
References clang::ovl_fail_bad_deduction, and clang::Sema::TDK_ConstraintsNotSatisfied.
Referenced by clang::OverloadCandidateSet::BestViableFunction().
Definition at line 922 of file Overload.h.
References clang::ConversionFixItGenerator::clear(), Conversions, Fix, and clang::ConversionFixItGenerator::tryToFixConversion().
Referenced by CompleteNonViableCandidate().
|
friend |
Definition at line 950 of file Overload.h.
union { ... } clang::OverloadCandidate::@234 |
bool clang::OverloadCandidate::Best |
Whether this candidate is the best viable function, or tied for being the best viable function.
For an ambiguous overload resolution, indicates whether this candidate was part of the ambiguity kernel: the minimal non-empty set of viable candidates such that all elements of the ambiguity kernel are better than all viable candidates not in the ambiguity kernel.
Definition at line 864 of file Overload.h.
Referenced by clang::OverloadCandidateSet::BestViableFunction().
QualType clang::OverloadCandidate::BuiltinParamTypes[3] |
BuiltinParamTypes - Provides the parameter types of a built-in overload candidate.
Only valid when Function is NULL.
Definition at line 840 of file Overload.h.
Referenced by clang::Sema::AddBuiltinCandidate(), CompleteNonViableCandidate(), and NoteBuiltinOperatorCandidate().
ConversionSequenceList clang::OverloadCandidate::Conversions |
The conversion sequences used to convert the function arguments to the function parameters.
Note that these are indexed by argument, so may not match the parameter order of Function.
Definition at line 849 of file Overload.h.
Referenced by clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), CompleteNonViableCandidate(), DiagnoseBadConversion(), hasAmbiguousConversion(), clang::isBetterOverloadCandidate(), NoteAmbiguousUserConversions(), NoteBuiltinOperatorCandidate(), NoteFunctionCandidate(), clang::Sema::PerformCopyInitialization(), and TryToFixBadConversion().
DeductionFailureInfo clang::OverloadCandidate::DeductionFailure |
Definition at line 895 of file Overload.h.
Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), CheckArityMismatch(), DiagnoseBadDeduction(), and DiagnoseFailedEnableIfAttr().
unsigned clang::OverloadCandidate::ExplicitCallArguments |
The number of call arguments that were explicitly provided, to be used while performing partial ordering of function templates.
Definition at line 892 of file Overload.h.
Referenced by clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), getNumParams(), and clang::isBetterOverloadCandidate().
unsigned char clang::OverloadCandidate::FailureKind |
FailureKind - The reason why this candidate is not viable.
Actually an OverloadFailureKind.
Definition at line 888 of file Overload.h.
Referenced by clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), clang::Sema::BuildCallToObjectOfClassType(), CheckArityMismatch(), CompleteNonViableCandidate(), NoteFunctionCandidate(), NoteSurrogateCandidate(), and clang::Sema::PerformCopyInitialization().
StandardConversionSequence clang::OverloadCandidate::FinalConversion |
FinalConversion - For a conversion function (where Function is a CXXConversionDecl), the standard conversion that occurs after the call to the overload candidate to convert the result of calling the conversion function to the required type.
Definition at line 901 of file Overload.h.
Referenced by clang::Sema::AddConversionCandidate(), and clang::isBetterOverloadCandidate().
ConversionFixItGenerator clang::OverloadCandidate::Fix |
The FixIt hints which can be used to fix the Bad candidate.
Definition at line 852 of file Overload.h.
Referenced by CompleteNonViableCandidate(), DiagnoseBadConversion(), and TryToFixBadConversion().
DeclAccessPair clang::OverloadCandidate::FoundDecl |
FoundDecl - The original declaration that was looked up / invented / otherwise found, together with its access.
Might be a UsingShadowDecl or a FunctionTemplateDecl.
Definition at line 836 of file Overload.h.
Referenced by clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), DiagnoseArityMismatch(), DiagnoseBadConversion(), DiagnoseBadDeduction(), DiagnoseBadTarget(), clang::isBetterOverloadCandidate(), and NoteFunctionCandidate().
FunctionDecl* clang::OverloadCandidate::Function |
Function - The actual function that this candidate represents.
When NULL, this is a built-in candidate (C++ [over.oper]) or a surrogate for a conversion to a function pointer or reference (C++ [over.call.object]).
Definition at line 831 of file Overload.h.
Referenced by clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), clang::OverloadCandidateSet::BestViableFunction(), CheckArityMismatch(), CompleteNonViableCandidate(), DiagnoseArityMismatch(), DiagnoseBadConversion(), DiagnoseBadDeduction(), DiagnoseBadTarget(), DiagnoseFailedEnableIfAttr(), DiagnoseFailedExplicitSpec(), GetLocationForCandidate(), getNumParams(), isBetterMultiversionCandidate(), clang::isBetterOverloadCandidate(), clang::OverloadCandidateSet::NoteCandidates(), NoteFunctionCandidate(), and sameFunctionParameterTypeLists().
bool clang::OverloadCandidate::IgnoreObjectArgument |
IgnoreObjectArgument - True to indicate that the first argument's conversion, which for this function represents the implicit object argument, should be ignored.
This will be true when the candidate is a static member function (where the implicit object argument is just a placeholder) or a non-static member function when the call doesn't have an object argument.
Definition at line 878 of file Overload.h.
Referenced by clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), CompleteNonViableCandidate(), clang::isBetterOverloadCandidate(), and NoteFunctionCandidate().
CallExpr::ADLCallKind clang::OverloadCandidate::IsADLCandidate |
True if the candidate was found using ADL.
Definition at line 881 of file Overload.h.
Referenced by clang::Sema::AddOverloadCandidate(), and clang::Sema::AddTemplateOverloadCandidate().
bool clang::OverloadCandidate::IsSurrogate |
IsSurrogate - True to indicate that this candidate is a surrogate for a conversion to a function pointer or reference (C++ [over.call.object]).
Definition at line 869 of file Overload.h.
Referenced by clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), CompleteNonViableCandidate(), GetLocationForCandidate(), getNumParams(), and clang::OverloadCandidateSet::NoteCandidates().
unsigned clang::OverloadCandidate::RewriteKind |
Whether this is a rewritten candidate, and if so, of what kind?
Definition at line 884 of file Overload.h.
Referenced by clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddTemplateOverloadCandidate(), getRewriteKind(), and clang::isBetterOverloadCandidate().
CXXConversionDecl* clang::OverloadCandidate::Surrogate |
Surrogate - The conversion function for which this candidate is a surrogate, but only if IsSurrogate is true.
Definition at line 844 of file Overload.h.
Referenced by clang::Sema::AddSurrogateCandidate(), CompleteNonViableCandidate(), GetLocationForCandidate(), getNumParams(), and NoteSurrogateCandidate().
bool clang::OverloadCandidate::Viable |
Viable - True to indicate that this overload candidate is viable.
Definition at line 855 of file Overload.h.
Referenced by clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), clang::OverloadCandidateSet::BestViableFunction(), clang::Sema::BuildCallToObjectOfClassType(), CompleteNonViableCandidate(), clang::isBetterOverloadCandidate(), clang::OverloadCandidateSet::NoteCandidates(), NoteFunctionCandidate(), NoteSurrogateCandidate(), and clang::Sema::PerformCopyInitialization().