clang API Documentation
#include <Overload.h>

Public Member Functions | |
| void | setFromType (QualType T) |
| void | setToType (unsigned Idx, QualType T) |
| void | setAllToTypes (QualType T) |
| QualType | getFromType () const |
| QualType | getToType (unsigned Idx) const |
| void | setAsIdentityConversion () |
| bool | isIdentityConversion () const |
| ImplicitConversionRank | getRank () const |
| NarrowingKind | getNarrowingKind (ASTContext &Context, const Expr *Converted, APValue &ConstantValue, QualType &ConstantType) const |
| bool | isPointerConversionToBool () const |
| bool | isPointerConversionToVoidPointer (ASTContext &Context) const |
| void | DebugPrint () const |
Public Attributes | |
| ImplicitConversionKind | First: 8 |
| ImplicitConversionKind | Second: 8 |
| ImplicitConversionKind | Third: 8 |
| Third - The third conversion can be a qualification conversion. | |
| unsigned | DeprecatedStringLiteralToCharPtr: 1 |
| Whether this is the deprecated conversion of a string literal to a pointer to non-const character data (C++ 4.2p2). | |
| unsigned | QualificationIncludesObjCLifetime: 1 |
| Whether the qualification conversion involves a change in the Objective-C lifetime (for automatic reference counting). | |
| unsigned | IncompatibleObjC: 1 |
| unsigned | ReferenceBinding: 1 |
| unsigned | DirectBinding: 1 |
| unsigned | IsLvalueReference: 1 |
| Whether this is an lvalue reference binding (otherwise, it's an rvalue reference binding). | |
| unsigned | BindsToFunctionLvalue: 1 |
| Whether we're binding to a function lvalue. | |
| unsigned | BindsToRvalue: 1 |
| Whether we're binding to an rvalue. | |
| unsigned | BindsImplicitObjectArgumentWithoutRefQualifier: 1 |
| Whether this binds an implicit object argument to a non-static member function without a ref-qualifier. | |
| unsigned | ObjCLifetimeConversionBinding: 1 |
| Whether this binds a reference to an object with a different Objective-C lifetime qualifier. | |
| void * | FromTypePtr |
| void * | ToTypePtrs [3] |
| CXXConstructorDecl * | CopyConstructor |
StandardConversionSequence - represents a standard conversion sequence (C++ 13.3.3.1.1). A standard conversion sequence contains between zero and three conversions. If a particular conversion is not needed, it will be set to the identity conversion (ICK_Identity). Note that the three conversions are specified as separate members (rather than in an array) so that we can keep the size of a standard conversion sequence to a single word.
Definition at line 140 of file Overload.h.
| void clang::StandardConversionSequence::DebugPrint | ( | ) | const |
DebugPrint - Print this standard conversion sequence to standard error. Useful for debugging overloading issues.
Definition at line 430 of file SemaOverload.cpp.
References clang::GetImplicitConversionName(), and clang::ICK_Identity.
| QualType clang::StandardConversionSequence::getFromType | ( | ) | const [inline] |
Definition at line 223 of file Overload.h.
References FromTypePtr, and clang::QualType::getFromOpaquePtr().
Referenced by clang::CheckConvertedConstantConversions(), clang::CompareDerivedToBaseConversions(), and clang::CompareStandardConversionSequences().
| NarrowingKind clang::StandardConversionSequence::getNarrowingKind | ( | ASTContext & | Ctx, |
| const Expr * | Converted, | ||
| APValue & | ConstantValue, | ||
| QualType & | ConstantType | ||
| ) | const |
Check if this standard conversion sequence represents a narrowing conversion, according to C++11 [dcl.init.list]p7.
| Ctx | The AST context. |
| Converted | The result of applying this standard conversion sequence. |
| ConstantValue | If this is an NK_Constant_Narrowing conversion, the value of the expression prior to the narrowing conversion. |
| ConstantType | If this is an NK_Constant_Narrowing conversion, the type of the expression prior to the narrowing conversion. |
Definition at line 295 of file SemaOverload.cpp.
References clang::APValue::getFloat(), clang::ASTContext::getFloatingTypeOrder(), clang::ASTContext::getFloatTypeSemantics(), clang::ASTContext::getIntWidth(), clang::ASTContext::getLangOpts(), clang::Expr::getType(), clang::ICK_Boolean_Conversion, clang::ICK_Floating_Conversion, clang::ICK_Floating_Integral, clang::ICK_Integral_Conversion, clang::IgnoreNarrowingConversion(), clang::Expr::isCXX11ConstantExpr(), clang::APValue::isFloat(), clang::Expr::isIntegerConstantExpr(), clang::NK_Constant_Narrowing, clang::NK_Not_Narrowing, clang::NK_Type_Narrowing, and clang::NK_Variable_Narrowing.
Referenced by clang::Sema::CheckConvertedConstantExpression(), and DiagnoseNarrowingInInitList().
| ImplicitConversionRank clang::StandardConversionSequence::getRank | ( | ) | const |
getRank - Retrieve the rank of this standard conversion sequence (C++ 13.3.3.1.1p3). The rank is the largest rank of each of the implicit conversions.
Definition at line 208 of file SemaOverload.cpp.
References clang::GetConversionRank(), and clang::ICR_Exact_Match.
Referenced by clang::CompareStandardConversionSequences().
| QualType clang::StandardConversionSequence::getToType | ( | unsigned | Idx | ) | const [inline] |
Definition at line 226 of file Overload.h.
References clang::QualType::getFromOpaquePtr(), and ToTypePtrs.
Referenced by clang::CheckConvertedConstantConversions(), clang::CompareDerivedToBaseConversions(), clang::CompareQualificationConversions(), clang::CompareStandardConversionSequences(), clang::compareStandardConversionSubsets(), clang::InitializationSequence::InitializationSequence(), and TryRefInitWithConversionFunction().
| bool clang::StandardConversionSequence::isIdentityConversion | ( | ) | const [inline] |
Definition at line 233 of file Overload.h.
References clang::ICK_Identity, Second, and Third.
Referenced by clang::compareStandardConversionSubsets().
| bool clang::StandardConversionSequence::isPointerConversionToBool | ( | ) | const |
isPointerConversionToBool - Determines whether this conversion is a conversion of a pointer or pointer-to-member to bool. This is used as part of the ranking of standard conversion sequences (C++ 13.3.3.2p4).
Definition at line 223 of file SemaOverload.cpp.
References clang::ICK_Array_To_Pointer, clang::ICK_Function_To_Pointer, and isBooleanType().
Referenced by clang::CompareStandardConversionSequences().
| bool clang::StandardConversionSequence::isPointerConversionToVoidPointer | ( | ASTContext & | Context | ) | const |
isPointerConversionToVoidPointer - Determines whether this conversion is a conversion of a pointer to a void pointer. This is used as part of the ranking of standard conversion sequences (C++ 13.3.3.2p4).
Definition at line 245 of file SemaOverload.cpp.
References clang::ASTContext::getArrayDecayedType(), clang::ICK_Array_To_Pointer, and clang::ICK_Pointer_Conversion.
Referenced by clang::CompareStandardConversionSequences().
| void clang::StandardConversionSequence::setAllToTypes | ( | QualType | T | ) | [inline] |
Definition at line 217 of file Overload.h.
References clang::QualType::getAsOpaquePtr(), and ToTypePtrs.
Referenced by clang::Sema::AddConversionCandidate(), clang::InitializationSequence::InitializationSequence(), clang::IsInitializerListConstructorConversion(), clang::IsStandardConversion(), clang::IsUserDefinedConversion(), clang::TryImplicitConversion(), clang::TryListConversion(), clang::TryObjectArgumentInitialization(), and clang::TryUserDefinedConversion().
| void clang::StandardConversionSequence::setAsIdentityConversion | ( | ) |
StandardConversionSequence - Set the standard conversion sequence to the identity conversion.
Definition at line 189 of file SemaOverload.cpp.
References clang::ICK_Identity.
Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::AddSurrogateCandidate(), clang::InitializationSequence::InitializationSequence(), clang::IsInitializerListConstructorConversion(), clang::IsStandardConversion(), clang::IsUserDefinedConversion(), clang::TryImplicitConversion(), clang::TryListConversion(), tryObjCWritebackConversion(), clang::TryObjectArgumentInitialization(), and clang::TryUserDefinedConversion().
| void clang::StandardConversionSequence::setFromType | ( | QualType | T | ) | [inline] |
Definition at line 212 of file Overload.h.
References FromTypePtr, and clang::QualType::getAsOpaquePtr().
Referenced by clang::Sema::AddConversionCandidate(), clang::IsInitializerListConstructorConversion(), clang::IsStandardConversion(), clang::IsUserDefinedConversion(), clang::TryImplicitConversion(), clang::TryListConversion(), clang::TryObjectArgumentInitialization(), and clang::TryUserDefinedConversion().
| void clang::StandardConversionSequence::setToType | ( | unsigned | Idx, |
| QualType | T | ||
| ) | [inline] |
Definition at line 213 of file Overload.h.
References clang::QualType::getAsOpaquePtr(), and ToTypePtrs.
Referenced by clang::IsStandardConversion(), and clang::tryAtomicConversion().
Whether this binds an implicit object argument to a non-static member function without a ref-qualifier.
Definition at line 189 of file Overload.h.
Referenced by clang::isBetterReferenceBindingKind(), clang::TryListConversion(), and clang::TryObjectArgumentInitialization().
Whether we're binding to a function lvalue.
Definition at line 182 of file Overload.h.
Referenced by clang::isBetterReferenceBindingKind(), clang::TryListConversion(), and clang::TryObjectArgumentInitialization().
Whether we're binding to an rvalue.
Definition at line 185 of file Overload.h.
Referenced by clang::isBetterReferenceBindingKind(), clang::TryListConversion(), and clang::TryObjectArgumentInitialization().
CopyConstructor - The copy constructor that is used to perform this conversion, when the conversion is actually just the initialization of an object via copy constructor. Such conversions are either identity conversions or derived-to-base conversions.
Definition at line 210 of file Overload.h.
Referenced by clang::IsStandardConversion(), clang::Sema::PerformImplicitConversion(), clang::TryImplicitConversion(), and clang::TryUserDefinedConversion().
Whether this is the deprecated conversion of a string literal to a pointer to non-const character data (C++ 4.2p2).
Definition at line 159 of file Overload.h.
Referenced by clang::CompareQualificationConversions(), clang::IsStandardConversion(), and clang::Sema::PerformImplicitConversion().
DirectBinding - True when this is a reference binding that is a direct binding (C++ [dcl.init.ref]).
Definition at line 175 of file Overload.h.
Referenced by clang::FindConversionForRefInit(), and clang::TryObjectArgumentInitialization().
First -- The first conversion can be an lvalue-to-rvalue conversion, array-to-pointer conversion, or function-to-pointer conversion.
Definition at line 145 of file Overload.h.
Referenced by clang::CompareDerivedToBaseConversions(), clang::CompareQualificationConversions(), clang::CompareStandardConversionSequences(), clang::InitializationSequence::InitializationSequence(), clang::IsStandardConversion(), clang::Sema::PerformImplicitConversion(), and tryObjCWritebackConversion().
FromType - The type that this conversion is converting from. This is an opaque pointer that can be translated into a QualType.
Definition at line 198 of file Overload.h.
Referenced by getFromType(), and setFromType().
IncompatibleObjC - Whether this is an Objective-C conversion that we should warn about (if we actually use it).
Definition at line 167 of file Overload.h.
Referenced by clang::IsStandardConversion(), and clang::Sema::PerformImplicitConversion().
Whether this is an lvalue reference binding (otherwise, it's an rvalue reference binding).
Definition at line 179 of file Overload.h.
Referenced by clang::isBetterReferenceBindingKind(), clang::TryListConversion(), and clang::TryObjectArgumentInitialization().
Whether this binds a reference to an object with a different Objective-C lifetime qualifier.
Definition at line 193 of file Overload.h.
Referenced by clang::CompareStandardConversionSequences(), and clang::TryListConversion().
Whether the qualification conversion involves a change in the Objective-C lifetime (for automatic reference counting).
Definition at line 163 of file Overload.h.
Referenced by clang::CompareQualificationConversions(), clang::IsStandardConversion(), and clang::tryAtomicConversion().
ReferenceBinding - True when this is a reference binding (C++ [over.ics.ref]).
Definition at line 171 of file Overload.h.
Referenced by clang::CompareStandardConversionSequences(), clang::FindConversionForRefInit(), clang::TryListConversion(), and clang::TryObjectArgumentInitialization().
Second - The second conversion can be an integral promotion, floating point promotion, integral conversion, floating point conversion, floating-integral conversion, pointer conversion, pointer-to-member conversion, or boolean conversion.
Definition at line 151 of file Overload.h.
Referenced by clang::CheckConvertedConstantConversions(), clang::CompareDerivedToBaseConversions(), clang::CompareQualificationConversions(), clang::CompareStandardConversionSequences(), clang::compareStandardConversionSubsets(), clang::dropPointerConversion(), clang::InitializationSequence::InitializationSequence(), isIdentityConversion(), clang::IsStandardConversion(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformObjectArgumentInitialization(), clang::tryAtomicConversion(), clang::TryImplicitConversion(), clang::TryObjectArgumentInitialization(), and clang::TryUserDefinedConversion().
Third - The third conversion can be a qualification conversion.
Definition at line 154 of file Overload.h.
Referenced by clang::CompareQualificationConversions(), clang::compareStandardConversionSubsets(), clang::dropPointerConversion(), isIdentityConversion(), clang::IsStandardConversion(), clang::Sema::PerformImplicitConversion(), and clang::tryAtomicConversion().
ToType - The types that this conversion is converting to in each step. This is an opaque pointer that can be translated into a QualType.
Definition at line 203 of file Overload.h.
Referenced by clang::dropPointerConversion(), getToType(), setAllToTypes(), and setToType().