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"
270 ImplicitConversionKind Dimension);
323 LLVM_PREFERRED_TYPE(
bool)
328 LLVM_PREFERRED_TYPE(
bool)
333 LLVM_PREFERRED_TYPE(
bool)
338 LLVM_PREFERRED_TYPE(
bool)
343 LLVM_PREFERRED_TYPE(
bool)
348 LLVM_PREFERRED_TYPE(
bool)
352 LLVM_PREFERRED_TYPE(
bool)
356 LLVM_PREFERRED_TYPE(
bool)
361 LLVM_PREFERRED_TYPE(
bool)
366 LLVM_PREFERRED_TYPE(
bool)
373 LLVM_PREFERRED_TYPE(
bool)
397 assert(Idx < 3 &&
"To type index is out of range");
412 assert(Idx < 3 &&
"To type index is out of range");
439 if (
T->isArrayType() ||
T->isFunctionType())
440 T =
C.getDecayedType(
T);
446 T =
C.getDecayedType(N->getPointeeType());
448 return T.getAtomicUnqualifiedType();
469 bool IgnoreFloatToIntegralConversion =
false,
470 bool AllowRelaxedEval =
false)
const;
647 LLVM_PREFERRED_TYPE(Kind)
648 unsigned ConversionKind : 31;
651 LLVM_PREFERRED_TYPE(
bool)
652 unsigned InitializerListOfIncompleteArray : 1;
659 QualType InitializerListContainerType;
661 void setKind(Kind K) {
690 : ConversionKind(Uninitialized),
691 InitializerListOfIncompleteArray(
false) {
696 : ConversionKind(
Other.ConversionKind),
697 InitializerListOfIncompleteArray(
698 Other.InitializerListOfIncompleteArray),
699 InitializerListContainerType(
Other.InitializerListContainerType) {
700 switch (ConversionKind) {
701 case Uninitialized:
break;
724 assert(
isInitialized() &&
"querying uninitialized conversion");
725 return Kind(ConversionKind);
752 llvm_unreachable(
"Invalid ImplicitConversionSequence::Kind!");
811 return !InitializerListContainerType.isNull();
814 InitializerListContainerType =
T;
815 InitializerListOfIncompleteArray = IA;
818 return InitializerListOfIncompleteArray;
822 "not initializer list container");
823 return InitializerListContainerType;
830 bool NeedLValToRVal) {
934 struct OverloadCandidate {
963 LLVM_PREFERRED_TYPE(
bool)
973 LLVM_PREFERRED_TYPE(
bool)
979 LLVM_PREFERRED_TYPE(
bool)
989 LLVM_PREFERRED_TYPE(
bool)
992 LLVM_PREFERRED_TYPE(
bool)
998 LLVM_PREFERRED_TYPE(
bool)
1002 LLVM_PREFERRED_TYPE(
CallExpr::ADLCallKind)
1006 LLVM_PREFERRED_TYPE(
bool)
1044 if (!
C.isInitialized())
return false;
1045 if (
C.isAmbiguous())
return true;
1056 if (!
C.isInitialized() || !
C.isPerfect(Ctx))
1065 bool CanFix =
Fix.tryToFixConversion(
1107 LLVM_PREFERRED_TYPE(Kind)
1109 LLVM_PREFERRED_TYPE(
bool)
1111 LLVM_PREFERRED_TYPE(
bool)
1113 LLVM_PREFERRED_TYPE(
bool)
1115 LLVM_PREFERRED_TYPE(
bool)
1117 LLVM_PREFERRED_TYPE(
bool)
1119 LLVM_PREFERRED_TYPE(
bool)
1131 static_assert(std::is_trivially_destructible_v<
1144 static_assert(std::is_trivially_destructible_v<
1156 static_assert(std::is_trivially_destructible_v<
1200 bool AllowRewritten)
1267 unsigned DeferredCandidatesCount : 8 *
sizeof(
unsigned) - 2;
1268 LLVM_PREFERRED_TYPE(
bool)
1269 unsigned HasDeferredTemplateConstructors : 1;
1270 LLVM_PREFERRED_TYPE(
bool)
1271 unsigned ResolutionByPerfectCandidateIsDisabled : 1;
1276 llvm::BumpPtrAllocator SlabAllocator;
1279 CandidateSetKind Kind;
1280 OperatorRewriteInfo RewriteInfo;
1284 constexpr static unsigned NumInlineBytes =
1287 unsigned NumInlineBytesUsed = 0;
1288 alignas(
void *)
char InlineSpace[NumInlineBytes];
1297 template <
typename T>
1298 T *slabAllocate(
unsigned N) {
1300 static_assert(
alignof(
T) ==
alignof(
void *),
1301 "Only works for pointer-aligned types.");
1302 static_assert(std::is_trivially_destructible_v<T> ||
1303 (std::is_same_v<ImplicitConversionSequence, T>),
1304 "Add destruction logic to OverloadCandidateSet::clear().");
1306 unsigned NBytes =
sizeof(
T) * N;
1307 if (NBytes > NumInlineBytes - NumInlineBytesUsed)
1308 return SlabAllocator.Allocate<
T>(N);
1309 char *FreeSpaceStart = InlineSpace + NumInlineBytesUsed;
1310 assert(
uintptr_t(FreeSpaceStart) %
alignof(
void *) == 0 &&
1311 "Misaligned storage!");
1313 NumInlineBytesUsed += NBytes;
1314 return reinterpret_cast<T *
>(FreeSpaceStart);
1322 template <
typename T> T *allocateDeferredCandidate() {
1323 T *C = slabAllocate<T>(1);
1324 if (!FirstDeferredCandidate)
1325 FirstDeferredCandidate = C;
1327 auto *F = FirstDeferredCandidate;
1332 DeferredCandidatesCount++;
1336 void destroyCandidates();
1341 : FirstDeferredCandidate(
nullptr), DeferredCandidatesCount(0),
1342 HasDeferredTemplateConstructors(
false),
1343 ResolutionByPerfectCandidateIsDisabled(
false), Loc(Loc), Kind(CSK),
1344 RewriteInfo(RewriteInfo) {}
1357 bool shouldDeferTemplateArgumentDeduction(
const Sema &S)
const;
1365 return Functions.insert(Key).second;
1375 void clear(CandidateSetKind CSK);
1382 size_t size()
const {
return Candidates.size() + DeferredCandidatesCount; }
1387 return Candidates.empty() && DeferredCandidatesCount == 0;
1395 slabAllocate<ImplicitConversionSequence>(NumConversions);
1398 for (
unsigned I = 0; I != NumConversions; ++I)
1410 Expr **Exprs = slabAllocate<Expr *>(N);
1414 template <
typename...
T>
1418 llvm::copy(std::initializer_list<Expr *>{Exprs...}, Arr.data());
1426 assert((Conversions.empty() || Conversions.size() == NumConversions) &&
1427 "preallocated conversion sequence has wrong length");
1431 C.Conversions = Conversions.empty()
1432 ? allocateConversionSequences(NumConversions)
1437 void AddDeferredTemplateCandidate(
1438 FunctionTemplateDecl *FunctionTemplate, DeclAccessPair FoundDecl,
1440 bool PartialOverloading,
bool AllowExplicit,
1441 CallExpr::ADLCallKind IsADLCandidate, OverloadCandidateParamOrder PO,
1442 bool AggregateCandidateDeduction);
1444 void AddDeferredMethodTemplateCandidate(
1445 FunctionTemplateDecl *MethodTmpl, DeclAccessPair FoundDecl,
1446 CXXRecordDecl *ActingContext, QualType ObjectType,
1448 bool SuppressUserConversions,
bool PartialOverloading,
1449 OverloadCandidateParamOrder PO);
1451 void AddDeferredConversionTemplateCandidate(
1452 FunctionTemplateDecl *FunctionTemplate, DeclAccessPair FoundDecl,
1453 CXXRecordDecl *ActingContext, Expr *From, QualType ToType,
1454 bool AllowObjCConversionOnExplicit,
bool AllowExplicit,
1455 bool AllowResultConversion);
1457 void InjectNonDeducedTemplateCandidates(Sema &S);
1460 ResolutionByPerfectCandidateIsDisabled =
true;
1473 void NoteCandidates(
1474 PartialDiagnosticAt PA, Sema &S, OverloadCandidateDisplayKind OCD,
1476 SourceLocation Loc = SourceLocation(),
1477 llvm::function_ref<
bool(OverloadCandidate &)> Filter =
1478 [](OverloadCandidate &) {
return true; });
1480 void NoteCandidates(Sema &S, ArrayRef<Expr *> Args,
1481 ArrayRef<OverloadCandidate *> Cands,
1483 SourceLocation OpLoc = SourceLocation());
1490 "can't set the destination address space when not constructing an "
1497 void CudaExcludeWrongSideCandidates(
1505 const OverloadCandidate &Cand2,
1532 Info.
Constructor = dyn_cast<CXXConstructorDecl>(D);
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.
Represents a C++ struct/union/class.
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...
The return type of classify().
This represents one expression.
Represents a function declaration or definition.
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
bool isPerfect(const ASTContext &C) const
A conversion sequence is perfect if it is an identity conversion and the type of the source is the sa...
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()
A pointer to member type per C++ 8.3.3 - Pointers to members.
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
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.
llvm::MutableArrayRef< Expr * > getPersistentArgsArray(T *...Exprs)
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 DisableResolutionByPerfectCandidate()
void setDestAS(LangAS AS)
ConversionSequenceList allocateConversionSequences(unsigned NumConversions)
Allocate storage for conversion sequences for NumConversions conversions.
OverloadCandidateSet(SourceLocation Loc, CandidateSetKind CSK, OperatorRewriteInfo RewriteInfo={})
llvm::MutableArrayRef< Expr * > getPersistentArgsArray(unsigned N)
Provide storage for any Expr* arg that must be preserved until deferred template candidates are deduc...
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.
@ CSK_CodeCompletion
When doing overload resolution during code completion, we want to show all viable candidates,...
SmallVectorImpl< OverloadCandidate >::iterator iterator
OverloadCandidateSet(const OverloadCandidateSet &)=delete
void exclude(Decl *F)
Exclude a function from being considered by overload resolution.
SourceLocation getLocation() const
OverloadCandidate & addCandidate(unsigned NumConversions=0, ConversionSequenceList Conversions={})
Add a new candidate with NumConversions conversion sequence slots to the overload set.
CandidateSetKind getKind() const
size_t nonDeferredCandidatesCount() const
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,...
bool isPerfect(const ASTContext &C) const
A conversion sequence is perfect if it is an identity conversion and the type of the source is the sa...
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.
NarrowingKind getNarrowingKind(ASTContext &Context, const Expr *Converted, APValue &ConstantValue, QualType &ConstantType, bool IgnoreFloatToIntegralConversion=false, bool AllowRelaxedEval=false) const
Check if this standard conversion sequence represents a narrowing conversion, according to C++11 [dcl...
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.
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)
unsigned FromBracedInitList
Whether the source expression was originally a single element braced-init-list.
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
Top level wrappers for InstallAPI frontend operations.
ImplicitConversionRank GetDimensionConversionRank(ImplicitConversionRank Base, ImplicitConversionKind Dimension)
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ OO_None
Not an overloaded operator.
bool isa(CodeGen::Address addr)
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.
bool isBetterOverloadCandidate(Sema &S, const OverloadCandidate &Cand1, const OverloadCandidate &Cand2, SourceLocation Loc, OverloadCandidateSet::CandidateSetKind Kind, bool PartialOverloading=false)
isBetterOverloadCandidate - Determines whether the first overload candidate is a better candidate tha...
@ 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.
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
llvm::MutableArrayRef< ImplicitConversionSequence > ConversionSequenceList
A list of implicit conversion sequences for the arguments of an OverloadCandidate.
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.
const FunctionProtoType * T
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_HLSL_Matrix_Splat
HLSL matrix splat from scalar or boolean type.
@ 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_HLSL_Matrix_Truncation
HLSL Matrix truncation.
@ 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 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.
ConstructorInfo getConstructorInfo(NamedDecl *ND)
ImplicitConversionRank GetConversionRank(ImplicitConversionKind Kind)
GetConversionRank - Retrieve the implicit conversion rank corresponding to the given implicit convers...
@ Other
Other implicit parameter.
Diagnostic wrappers for TextAPI types for error reporting.
__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()
SmallVector< std::pair< NamedDecl *, FunctionDecl * >, 4 > ConversionSet
void setFromType(QualType T)
const_iterator end() const
void setToType(QualType T)
void addConversion(NamedDecl *Found, FunctionDecl *D)
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.
A structure used to record information about a failed template argument deduction,...
FunctionTemplateDecl * FunctionTemplate
CXXRecordDecl * ActingContext
FunctionTemplateDecl * FunctionTemplate
CallExpr::ADLCallKind IsADLCandidate
OverloadCandidateParamOrder PO
Expr::Classification ObjectClassification
CXXRecordDecl * ActingContext
OverloadCandidateParamOrder PO
FunctionTemplateDecl * FunctionTemplate
unsigned AggregateCandidateDeduction
unsigned AllowObjCConversionOnExplicit
DeferredTemplateOverloadCandidate * Next
unsigned SuppressUserConversions
unsigned PartialOverloading
unsigned AllowResultConversion
Information about operator rewrites to consider when adding operator functions to a candidate set.
bool allowsReversed(OverloadedOperatorKind Op) const
Determine whether reversing parameter order is allowed for operator Op.
bool isRewrittenOperator(const FunctionDecl *FD) const
Would use of this function result in a rewrite using a different operator?
OperatorRewriteInfo(OverloadedOperatorKind Op, SourceLocation OpLoc, bool AllowRewritten)
bool isAcceptableCandidate(const FunctionDecl *FD) const
bool isReversible() const
Determines whether this operator could be implemented by a function with reversed parameter order.
SourceLocation OpLoc
The source location of the operator.
bool AllowRewrittenCandidates
Whether we should include rewritten candidates in the overload set.
OverloadedOperatorKind OriginalOperator
The original operator as written in the source.
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).
unsigned StrictPackMatch
Have we matched any packs on the parameter side, versus any non-packs on the argument side,...
unsigned IgnoreObjectArgument
IgnoreObjectArgument - True to indicate that the first argument's conversion, which for this function...
bool TryToFixBadConversion(unsigned Idx, Sema &S)
bool NotValidBecauseConstraintExprHasError() const
unsigned IsADLCandidate
True if the candidate was found using ADL.
unsigned 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 ...
DeclAccessPair FoundDecl
FoundDecl - The original declaration that was looked up / invented / otherwise found,...
FunctionDecl * Function
Function - The actual function that this candidate represents.
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.
unsigned Best
Whether this candidate is the best viable function, or tied for being the best viable function.
StandardConversionSequence FinalConversion
FinalConversion - For a conversion function (where Function is a CXXConversionDecl),...
unsigned getNumParams() const
unsigned HasFinalConversion
Whether FinalConversion has been set.
unsigned TookAddressOfOverload
unsigned 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 order...
ConversionSequenceList Conversions
The conversion sequences used to convert the function arguments to the function parameters.
friend class OverloadCandidateSet
DeductionFailureInfo DeductionFailure
unsigned Viable
Viable - True to indicate that this overload candidate is viable.
bool isPerfectMatch(const ASTContext &Ctx) const
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.