14#ifndef LLVM_CLANG_SEMA_OVERLOAD_H
15#define LLVM_CLANG_SEMA_OVERLOAD_H
28#include "llvm/ADT/ArrayRef.h"
29#include "llvm/ADT/STLExtras.h"
30#include "llvm/ADT/SmallPtrSet.h"
31#include "llvm/ADT/SmallVector.h"
32#include "llvm/ADT/StringRef.h"
33#include "llvm/Support/AlignOf.h"
34#include "llvm/Support/Allocator.h"
35#include "llvm/Support/Casting.h"
36#include "llvm/Support/ErrorHandling.h"
317 LLVM_PREFERRED_TYPE(
bool)
322 LLVM_PREFERRED_TYPE(
bool)
327 LLVM_PREFERRED_TYPE(
bool)
332 LLVM_PREFERRED_TYPE(
bool)
337 LLVM_PREFERRED_TYPE(
bool)
342 LLVM_PREFERRED_TYPE(
bool)
346 LLVM_PREFERRED_TYPE(
bool)
350 LLVM_PREFERRED_TYPE(
bool)
355 LLVM_PREFERRED_TYPE(
bool)
360 LLVM_PREFERRED_TYPE(
bool)
384 assert(Idx < 3 &&
"To type index is out of range");
399 assert(Idx < 3 &&
"To type index is out of range");
414 bool IgnoreFloatToIntegralConversion =
false)
const;
591 LLVM_PREFERRED_TYPE(
Kind)
592 unsigned ConversionKind : 31;
595 LLVM_PREFERRED_TYPE(
bool)
596 unsigned InitializerListOfIncompleteArray : 1;
603 QualType InitializerListContainerType;
605 void setKind(
Kind K) {
634 : ConversionKind(Uninitialized),
635 InitializerListOfIncompleteArray(
false) {
640 : ConversionKind(
Other.ConversionKind),
641 InitializerListOfIncompleteArray(
642 Other.InitializerListOfIncompleteArray),
643 InitializerListContainerType(
Other.InitializerListContainerType) {
644 switch (ConversionKind) {
645 case Uninitialized:
break;
668 assert(
isInitialized() &&
"querying uninitialized conversion");
669 return Kind(ConversionKind);
696 llvm_unreachable(
"Invalid ImplicitConversionSequence::Kind!");
718 Bad.
init(Failure, FromExpr, ToType);
725 Bad.
init(Failure, FromType, ToType);
749 return !InitializerListContainerType.isNull();
752 InitializerListContainerType =
T;
753 InitializerListOfIncompleteArray = IA;
756 return InitializerListOfIncompleteArray;
760 "not initializer list container");
761 return InitializerListContainerType;
768 bool NeedLValToRVal) {
965 if (!
C.isInitialized())
return false;
966 if (
C.isAmbiguous())
return true;
1042 bool AllowRewritten)
1110 llvm::BumpPtrAllocator SlabAllocator;
1114 OperatorRewriteInfo RewriteInfo;
1116 constexpr static unsigned NumInlineBytes =
1118 unsigned NumInlineBytesUsed = 0;
1119 alignas(
void *)
char InlineSpace[NumInlineBytes];
1130 template <
typename T>
1131 T *slabAllocate(
unsigned N) {
1133 static_assert(
alignof(
T) ==
alignof(
void *),
1134 "Only works for pointer-aligned types.");
1135 static_assert(std::is_trivial<T>::value ||
1136 std::is_same<ImplicitConversionSequence, T>::value,
1137 "Add destruction logic to OverloadCandidateSet::clear().");
1139 unsigned NBytes =
sizeof(
T) * N;
1140 if (NBytes > NumInlineBytes - NumInlineBytesUsed)
1141 return SlabAllocator.Allocate<
T>(N);
1142 char *FreeSpaceStart = InlineSpace + NumInlineBytesUsed;
1143 assert(
uintptr_t(FreeSpaceStart) %
alignof(
void *) == 0 &&
1144 "Misaligned storage!");
1146 NumInlineBytesUsed += NBytes;
1147 return reinterpret_cast<T *
>(FreeSpaceStart);
1150 void destroyCandidates();
1155 :
Loc(Loc), Kind(CSK), RewriteInfo(RewriteInfo) {}
1173 return Functions.insert(Key).second;
1190 size_t size()
const {
return Candidates.size(); }
1191 bool empty()
const {
return Candidates.empty(); }
1198 slabAllocate<ImplicitConversionSequence>(NumConversions);
1201 for (
unsigned I = 0; I != NumConversions; ++I)
1212 assert((Conversions.empty() || Conversions.size() == NumConversions) &&
1213 "preallocated conversion sequence has wrong length");
1217 C.Conversions = Conversions.empty()
1235 ArrayRef<Expr *> Args, StringRef Opc =
"",
1236 SourceLocation Loc = SourceLocation(),
1237 llvm::function_ref<
bool(OverloadCandidate &)> Filter =
1238 [](OverloadCandidate &) {
return true; });
1241 ArrayRef<OverloadCandidate *> Cands,
1243 SourceLocation OpLoc = SourceLocation());
1250 "can't set the destination address space when not constructing an "
1258 const OverloadCandidate &Cand1,
1259 const OverloadCandidate &Cand2,
1274 if (isa<UsingDecl>(ND))
enum clang::sema::@1656::IndirectLocalPathEntry::EntryKind Kind
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
C Language Family Type Representation.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a C++ constructor within a class.
Represents a C++ conversion function within a class.
QualType getConversionType() const
Returns the type that this conversion function is converting to.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
A POD class for pairing a NamedDecl* with an access specifier.
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
Decl - This represents one declaration (or definition), e.g.
AccessSpecifier getAccess() const
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
OverloadedOperatorKind getCXXOverloadedOperator() const
If this name is the name of an overloadable operator in C++ (e.g., operator+), retrieve the kind of o...
This represents one expression.
Represents a function declaration or definition.
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
Represents a prototype with parameter type info, e.g.
Declaration of a template function.
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
ImplicitConversionSequence - Represents an implicit conversion sequence, which may be a standard conv...
void dump() const
dump - Print this implicit conversion sequence to standard error.
ImplicitConversionSequence & operator=(const ImplicitConversionSequence &Other)
bool isUserDefined() const
Kind
Kind - The kind of implicit conversion sequence.
@ StaticObjectArgumentConversion
StandardConversionSequence Standard
When ConversionKind == StandardConversion, provides the details of the standard conversion sequence.
void setBad(BadConversionSequence::FailureKind Failure, Expr *FromExpr, QualType ToType)
Sets this sequence as a bad conversion for an explicit argument.
UserDefinedConversionSequence UserDefined
When ConversionKind == UserDefinedConversion, provides the details of the user-defined conversion seq...
ImplicitConversionSequence(const ImplicitConversionSequence &Other)
bool isInitialized() const
Determines whether this conversion sequence has been initialized.
static ImplicitConversionSequence getNullptrToBool(QualType SourceType, QualType DestType, bool NeedLValToRVal)
Form an "implicit" conversion sequence from nullptr_t to bool, for a direct-initialization of a bool ...
AmbiguousConversionSequence Ambiguous
When ConversionKind == AmbiguousConversion, provides the details of the ambiguous conversion.
void setInitializerListContainerType(QualType T, bool IA)
bool hasInitializerListContainerType() const
unsigned getKindRank() const
Return a ranking of the implicit conversion sequence kind, where smaller ranks represent better conve...
bool isStaticObjectArgument() const
void setStaticObjectArgument()
bool isInitializerListOfIncompleteArray() const
BadConversionSequence Bad
When ConversionKind == BadConversion, provides the details of the bad conversion.
QualType getInitializerListContainerType() const
~ImplicitConversionSequence()
void setAsIdentityConversion(QualType T)
void DiagnoseAmbiguousConversion(Sema &S, SourceLocation CaretLoc, const PartialDiagnostic &PDiag) const
Diagnoses an ambiguous conversion.
void setBad(BadConversionSequence::FailureKind Failure, QualType FromType, QualType ToType)
Sets this sequence as a bad conversion for an implicit argument.
ImplicitConversionSequence()
This represents a decl that may have a name.
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13....
void clear(CandidateSetKind CSK)
Clear out all of the candidates.
OverloadCandidateSet & operator=(const OverloadCandidateSet &)=delete
bool isNewCandidate(Decl *F, OverloadCandidateParamOrder PO=OverloadCandidateParamOrder::Normal)
Determine when this overload candidate will be new to the overload set.
void setDestAS(LangAS AS)
ConversionSequenceList allocateConversionSequences(unsigned NumConversions)
Allocate storage for conversion sequences for NumConversions conversions.
OverloadCandidateSet(SourceLocation Loc, CandidateSetKind CSK, OperatorRewriteInfo RewriteInfo={})
OverloadCandidate & addCandidate(unsigned NumConversions=0, ConversionSequenceList Conversions=std::nullopt)
Add a new candidate with NumConversions conversion sequence slots to the overload set.
OperatorRewriteInfo getRewriteInfo() const
@ CSK_AddressOfOverloadSet
C++ [over.match.call.general] Resolve a call through the address of an overload set.
@ CSK_InitByConstructor
C++ [over.match.ctor], [over.match.list] Initialization of an object of class type by constructor,...
@ CSK_InitByUserDefinedConversion
C++ [over.match.copy]: Copy-initialization of an object of class type by user-defined conversion.
@ CSK_Normal
Normal lookup.
@ CSK_Operator
C++ [over.match.oper]: Lookup of operator function candidates in a call using operator syntax.
SmallVectorImpl< OverloadCandidate >::iterator iterator
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...
OverloadCandidateSet(const OverloadCandidateSet &)=delete
bool shouldDeferDiags(Sema &S, ArrayRef< Expr * > Args, SourceLocation OpLoc)
Whether diagnostics should be deferred.
OverloadingResult BestViableFunction(Sema &S, SourceLocation Loc, OverloadCandidateSet::iterator &Best)
Find the best viable function on this overload set, if it exists.
void exclude(Decl *F)
Exclude a function from being considered by overload resolution.
SourceLocation getLocation() const
CandidateSetKind getKind() const
SmallVector< OverloadCandidate *, 32 > CompleteCandidates(Sema &S, OverloadCandidateDisplayKind OCD, ArrayRef< Expr * > Args, SourceLocation OpLoc=SourceLocation(), llvm::function_ref< bool(OverloadCandidate &)> Filter=[](OverloadCandidate &) { return true;})
A (possibly-)qualified type.
static QualType getFromOpaquePtr(const void *Ptr)
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
StandardConversionSequence - represents a standard conversion sequence (C++ 13.3.3....
void dump() const
dump - Print this standard conversion sequence to standard error.
void setFromType(QualType T)
DeclAccessPair FoundCopyConstructor
bool isIdentityConversion() const
void * FromTypePtr
FromType - The type that this conversion is converting from.
unsigned BindsToRvalue
Whether we're binding to an rvalue.
ImplicitConversionKind Second
Second - The second conversion can be an integral promotion, floating point promotion,...
QualType getFromType() const
ImplicitConversionKind First
First – The first conversion can be an lvalue-to-rvalue conversion, array-to-pointer conversion,...
unsigned BindsImplicitObjectArgumentWithoutRefQualifier
Whether this binds an implicit object argument to a non-static member function without a ref-qualifie...
unsigned ReferenceBinding
ReferenceBinding - True when this is a reference binding (C++ [over.ics.ref]).
void setAsIdentityConversion()
StandardConversionSequence - Set the standard conversion sequence to the identity conversion.
unsigned DeprecatedStringLiteralToCharPtr
Whether this is the deprecated conversion of a string literal to a pointer to non-const character dat...
CXXConstructorDecl * CopyConstructor
CopyConstructor - The copy constructor that is used to perform this conversion, when the conversion i...
unsigned IncompatibleObjC
IncompatibleObjC - Whether this is an Objective-C conversion that we should warn about (if we actuall...
unsigned ObjCLifetimeConversionBinding
Whether this binds a reference to an object with a different Objective-C lifetime qualifier.
ImplicitConversionKind Third
Third - The third conversion can be a qualification conversion or a function conversion.
unsigned QualificationIncludesObjCLifetime
Whether the qualification conversion involves a change in the Objective-C lifetime (for automatic ref...
void setToType(unsigned Idx, QualType T)
bool isPointerConversionToBool() const
isPointerConversionToBool - Determines whether this conversion is a conversion of a pointer or pointe...
void * ToTypePtrs[3]
ToType - The types that this conversion is converting to in each step.
NarrowingKind getNarrowingKind(ASTContext &Context, const Expr *Converted, APValue &ConstantValue, QualType &ConstantType, bool IgnoreFloatToIntegralConversion=false) const
Check if this standard conversion sequence represents a narrowing conversion, according to C++11 [dcl...
unsigned IsLvalueReference
Whether this is an lvalue reference binding (otherwise, it's an rvalue reference binding).
ImplicitConversionKind Dimension
Dimension - Between the second and third conversion a vector or matrix dimension conversion may occur...
unsigned BindsToFunctionLvalue
Whether we're binding to a function lvalue.
unsigned DirectBinding
DirectBinding - True when this is a reference binding that is a direct binding (C++ [dcl....
ImplicitConversionRank getRank() const
getRank - Retrieve the rank of this standard conversion sequence (C++ 13.3.3.1.1p3).
bool isPointerConversionToVoidPointer(ASTContext &Context) const
isPointerConversionToVoidPointer - Determines whether this conversion is a conversion of a pointer to...
void setAllToTypes(QualType T)
QualType getToType(unsigned Idx) const
const T * castAs() const
Member-template castAs<specific type>.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isPointerOrReferenceType() const
The JSON file list parser is used to communicate input to InstallAPI.
ImplicitConversionRank GetDimensionConversionRank(ImplicitConversionRank Base, ImplicitConversionKind Dimension)
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ OO_None
Not an overloaded operator.
llvm::MutableArrayRef< ImplicitConversionSequence > ConversionSequenceList
A list of implicit conversion sequences for the arguments of an OverloadCandidate.
OverloadingResult
OverloadingResult - Capture the result of performing overload resolution.
@ OR_Deleted
Succeeded, but refers to a deleted function.
@ OR_Success
Overload resolution succeeded.
@ OR_Ambiguous
Ambiguous candidates found.
@ OR_No_Viable_Function
No viable function found.
@ ovl_fail_final_conversion_not_exact
This conversion function template specialization candidate is not viable because the final conversion...
@ ovl_fail_enable_if
This candidate function was not viable because an enable_if attribute disabled it.
@ ovl_fail_illegal_constructor
This conversion candidate was not considered because it is an illegal instantiation of a constructor ...
@ ovl_fail_bad_final_conversion
This conversion candidate is not viable because its result type is not implicitly convertible to the ...
@ ovl_fail_module_mismatched
This candidate was not viable because it has internal linkage and is from a different module unit tha...
@ ovl_fail_too_few_arguments
@ ovl_fail_addr_not_available
This candidate was not viable because its address could not be taken.
@ ovl_fail_too_many_arguments
@ ovl_non_default_multiversion_function
This candidate was not viable because it is a non-default multiversioned function.
@ ovl_fail_constraints_not_satisfied
This candidate was not viable because its associated constraints were not satisfied.
@ ovl_fail_bad_conversion
@ ovl_fail_bad_target
(CUDA) This candidate was not viable because the callee was not accessible from the caller's target (...
@ ovl_fail_inhctor_slice
This inherited constructor is not viable because it would slice the argument.
@ ovl_fail_object_addrspace_mismatch
This constructor/conversion candidate fail due to an address space mismatch between the object being ...
@ ovl_fail_explicit
This candidate constructor or conversion function is explicit but the context doesn't permit explicit...
@ ovl_fail_trivial_conversion
This conversion candidate was not considered because it duplicates the work of a trivial or derived-t...
ImplicitConversionRank
ImplicitConversionRank - The rank of an implicit conversion kind.
@ ICR_Conversion
Conversion.
@ ICR_Writeback_Conversion
ObjC ARC writeback conversion.
@ ICR_HLSL_Dimension_Reduction
HLSL Matching Dimension Reduction.
@ ICR_HLSL_Dimension_Reduction_Conversion
HLSL Dimension reduction with conversion.
@ ICR_HLSL_Scalar_Widening
HLSL Scalar Widening.
@ ICR_C_Conversion
Conversion only allowed in the C standard (e.g. void* to char*).
@ ICR_OCL_Scalar_Widening
OpenCL Scalar Widening.
@ ICR_Complex_Real_Conversion
Complex <-> Real conversion.
@ ICR_HLSL_Scalar_Widening_Conversion
HLSL Scalar Widening with conversion.
@ ICR_HLSL_Dimension_Reduction_Promotion
HLSL Dimension reduction with promotion.
@ ICR_Promotion
Promotion.
@ ICR_Exact_Match
Exact Match.
@ ICR_C_Conversion_Extension
Conversion not allowed by the C standard, but that we accept as an extension anyway.
@ ICR_HLSL_Scalar_Widening_Promotion
HLSL Scalar Widening with promotion.
OverloadCandidateDisplayKind
@ OCD_AmbiguousCandidates
Requests that only tied-for-best candidates be shown.
@ OCD_ViableCandidates
Requests that only viable candidates be shown.
@ OCD_AllCandidates
Requests that all candidates be shown.
OverloadCandidateParamOrder
The parameter ordering that will be used for the candidate.
OverloadCandidateRewriteKind
The kinds of rewrite we perform on overload candidates.
@ CRK_Reversed
Candidate is a rewritten candidate with a reversed order of parameters.
@ CRK_None
Candidate is not a rewritten candidate.
@ CRK_DifferentOperator
Candidate is a rewritten candidate with a different operator name.
ImplicitConversionKind
ImplicitConversionKind - The kind of implicit conversion used to convert an argument to a parameter's...
@ ICK_Complex_Conversion
Complex conversions (C99 6.3.1.6)
@ ICK_Floating_Promotion
Floating point promotions (C++ [conv.fpprom])
@ ICK_Boolean_Conversion
Boolean conversions (C++ [conv.bool])
@ ICK_Integral_Conversion
Integral conversions (C++ [conv.integral])
@ ICK_Fixed_Point_Conversion
Fixed point type conversions according to N1169.
@ ICK_Vector_Conversion
Vector conversions.
@ ICK_Block_Pointer_Conversion
Block Pointer conversions.
@ ICK_Pointer_Member
Pointer-to-member conversions (C++ [conv.mem])
@ ICK_Floating_Integral
Floating-integral conversions (C++ [conv.fpint])
@ ICK_HLSL_Array_RValue
HLSL non-decaying array rvalue cast.
@ ICK_SVE_Vector_Conversion
Arm SVE Vector conversions.
@ ICK_HLSL_Vector_Truncation
HLSL vector truncation.
@ ICK_Incompatible_Pointer_Conversion
C-only conversion between pointers with incompatible types.
@ ICK_Array_To_Pointer
Array-to-pointer conversion (C++ [conv.array])
@ ICK_RVV_Vector_Conversion
RISC-V RVV Vector conversions.
@ ICK_Complex_Promotion
Complex promotions (Clang extension)
@ ICK_Num_Conversion_Kinds
The number of conversion kinds.
@ ICK_Function_Conversion
Function pointer conversion (C++17 [conv.fctptr])
@ ICK_Vector_Splat
A vector splat from an arithmetic type.
@ ICK_Zero_Queue_Conversion
Zero constant to queue.
@ ICK_Identity
Identity conversion (no conversion)
@ ICK_Derived_To_Base
Derived-to-base (C++ [over.best.ics])
@ ICK_Lvalue_To_Rvalue
Lvalue-to-rvalue conversion (C++ [conv.lval])
@ ICK_Qualification
Qualification conversions (C++ [conv.qual])
@ ICK_Pointer_Conversion
Pointer conversions (C++ [conv.ptr])
@ ICK_TransparentUnionConversion
Transparent Union Conversions.
@ ICK_Integral_Promotion
Integral promotions (C++ [conv.prom])
@ ICK_Floating_Conversion
Floating point conversions (C++ [conv.double].
@ ICK_Compatible_Conversion
Conversions between compatible types in C99.
@ ICK_C_Only_Conversion
Conversions allowed in C, but not C++.
@ ICK_Writeback_Conversion
Objective-C ARC writeback conversion.
@ ICK_Zero_Event_Conversion
Zero constant to event (OpenCL1.2 6.12.10)
@ ICK_Complex_Real
Complex-real conversions (C99 6.3.1.7)
@ ICK_Function_To_Pointer
Function-to-pointer (C++ [conv.array])
LangAS
Defines the address space values used by the address space qualifier of QualType.
OverloadedOperatorKind getRewrittenOverloadedOperator(OverloadedOperatorKind Kind)
Get the other overloaded operator that the given operator can be rewritten into, if any such operator...
bool isBetterOverloadCandidate(Sema &S, const OverloadCandidate &Cand1, const OverloadCandidate &Cand2, SourceLocation Loc, OverloadCandidateSet::CandidateSetKind Kind)
isBetterOverloadCandidate - Determines whether the first overload candidate is a better candidate tha...
const FunctionProtoType * T
bool shouldEnforceArgLimit(bool PartialOverloading, FunctionDecl *Function)
NarrowingKind
NarrowingKind - The kind of narrowing conversion being performed by a standard conversion sequence ac...
@ NK_Not_Narrowing
Not a narrowing conversion.
@ NK_Constant_Narrowing
A narrowing conversion, because a constant expression got narrowed.
@ NK_Dependent_Narrowing
Cannot tell whether this is a narrowing conversion because the expression is value-dependent.
@ NK_Type_Narrowing
A narrowing conversion by virtue of the source and destination types.
@ NK_Variable_Narrowing
A narrowing conversion, because a non-constant-expression variable might have got narrowed.
std::pair< SourceLocation, PartialDiagnostic > PartialDiagnosticAt
A partial diagnostic along with the source location where this diagnostic occurs.
ConstructorInfo getConstructorInfo(NamedDecl *ND)
ImplicitConversionRank GetConversionRank(ImplicitConversionKind Kind)
GetConversionRank - Retrieve the implicit conversion rank corresponding to the given implicit convers...
@ Other
Other implicit parameter.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Represents an ambiguous user-defined conversion sequence.
ConversionSet::const_iterator const_iterator
QualType getFromType() const
const ConversionSet & conversions() const
QualType getToType() const
ConversionSet & conversions()
void setFromType(QualType T)
const_iterator end() const
void setToType(QualType T)
void addConversion(NamedDecl *Found, FunctionDecl *D)
SmallVector< std::pair< NamedDecl *, FunctionDecl * >, 4 > ConversionSet
char Buffer[sizeof(ConversionSet)]
void copyFrom(const AmbiguousConversionSequence &)
ConversionSet::iterator iterator
const_iterator begin() const
BadConversionSequence - Records information about an invalid conversion sequence.
void setToType(QualType T)
void setFromType(QualType T)
void init(FailureKind K, Expr *From, QualType To)
void init(FailureKind K, QualType From, QualType To)
QualType getToType() const
void setFromExpr(Expr *E)
QualType getFromType() const
FunctionTemplateDecl * ConstructorTmpl
CXXConstructorDecl * Constructor
The class facilities generation and storage of conversion FixIts.
bool tryToFixConversion(const Expr *FromExpr, const QualType FromQTy, const QualType ToQTy, Sema &S)
If possible, generates and stores a fix for the given conversion.
A structure used to record information about a failed template argument deduction,...
Information about operator rewrites to consider when adding operator functions to a candidate set.
bool shouldAddReversed(Sema &S, ArrayRef< Expr * > OriginalArgs, FunctionDecl *FD)
Determine whether we should add a rewritten candidate for FD with reversed parameter order.
bool allowsReversed(OverloadedOperatorKind Op)
Determine whether reversing parameter order is allowed for operator Op.
OperatorRewriteInfo(OverloadedOperatorKind Op, SourceLocation OpLoc, bool AllowRewritten)
bool isRewrittenOperator(const FunctionDecl *FD)
Would use of this function result in a rewrite using a different operator?
SourceLocation OpLoc
The source location of the operator.
bool AllowRewrittenCandidates
Whether we should include rewritten candidates in the overload set.
bool isReversible()
Determines whether this operator could be implemented by a function with reversed parameter order.
OverloadedOperatorKind OriginalOperator
The original operator as written in the source.
bool isAcceptableCandidate(const FunctionDecl *FD)
OverloadCandidateRewriteKind getRewriteKind(const FunctionDecl *FD, OverloadCandidateParamOrder PO)
Determine the kind of rewrite that should be performed for this candidate.
OverloadCandidate - A single candidate in an overload set (C++ 13.3).
CallExpr::ADLCallKind IsADLCandidate
True if the candidate was found using ADL.
bool TryToFixBadConversion(unsigned Idx, Sema &S)
bool NotValidBecauseConstraintExprHasError() const
bool IsSurrogate
IsSurrogate - True to indicate that this candidate is a surrogate for a conversion to a function poin...
QualType BuiltinParamTypes[3]
BuiltinParamTypes - Provides the parameter types of a built-in overload candidate.
bool hasAmbiguousConversion() const
hasAmbiguousConversion - Returns whether this overload candidate requires an ambiguous conversion or ...
bool IgnoreObjectArgument
IgnoreObjectArgument - True to indicate that the first argument's conversion, which for this function...
DeclAccessPair FoundDecl
FoundDecl - The original declaration that was looked up / invented / otherwise found,...
FunctionDecl * Function
Function - The actual function that this candidate represents.
bool Viable
Viable - True to indicate that this overload candidate is viable.
unsigned RewriteKind
Whether this is a rewritten candidate, and if so, of what kind?
ConversionFixItGenerator Fix
The FixIt hints which can be used to fix the Bad candidate.
StandardConversionSequence FinalConversion
FinalConversion - For a conversion function (where Function is a CXXConversionDecl),...
unsigned getNumParams() const
unsigned ExplicitCallArguments
The number of call arguments that were explicitly provided, to be used while performing partial order...
unsigned char FailureKind
FailureKind - The reason why this candidate is not viable.
ConversionSequenceList Conversions
The conversion sequences used to convert the function arguments to the function parameters.
bool TookAddressOfOverload
DeductionFailureInfo DeductionFailure
bool Best
Whether this candidate is the best viable function, or tied for being the best viable function.
CXXConversionDecl * Surrogate
Surrogate - The conversion function for which this candidate is a surrogate, but only if IsSurrogate ...
OverloadCandidateRewriteKind getRewriteKind() const
Get RewriteKind value in OverloadCandidateRewriteKind type (This function is to workaround the spurio...
UserDefinedConversionSequence - Represents a user-defined conversion sequence (C++ 13....
StandardConversionSequence Before
Represents the standard conversion that occurs before the actual user-defined conversion.
FunctionDecl * ConversionFunction
ConversionFunction - The function that will perform the user-defined conversion.
bool HadMultipleCandidates
HadMultipleCandidates - When this is true, it means that the conversion function was resolved from an...
StandardConversionSequence After
After - Represents the standard conversion that occurs after the actual user-defined conversion.
bool EllipsisConversion
EllipsisConversion - When this is true, it means user-defined conversion sequence starts with a ....
DeclAccessPair FoundConversionFunction
The declaration that we found via name lookup, which might be the same as ConversionFunction or it mi...
void dump() const
dump - Print this user-defined conversion sequence to standard error.