clang API Documentation
Represents a C++ conversion function within a class. More...
#include <DeclCXX.h>
Public Member Functions | |
bool | isExplicitSpecified () const |
bool | isExplicit () const |
Whether this is an explicit conversion operator (C++11 and later). | |
QualType | getConversionType () const |
Returns the type that this conversion function is converting to. | |
bool | isLambdaToBlockPointerConversion () const |
Determine whether this conversion function is a conversion from a lambda closure type to a block pointer. | |
Static Public Member Functions | |
static CXXConversionDecl * | Create (ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, bool isExplicit, bool isConstexpr, SourceLocation EndLocation) |
static CXXConversionDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
Friends | |
class | ASTDeclReader |
class | ASTDeclWriter |
Represents a C++ conversion function within a class.
For example:
class X { public: operator bool(); };
static bool clang::CXXConversionDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Reimplemented from clang::CXXMethodDecl.
Definition at line 2446 of file DeclCXX.h.
References classofKind(), and clang::Decl::getKind().
static bool clang::CXXConversionDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::CXXMethodDecl.
Definition at line 2447 of file DeclCXX.h.
Referenced by classof().
CXXConversionDecl * CXXConversionDecl::Create | ( | ASTContext & | C, |
CXXRecordDecl * | RD, | ||
SourceLocation | StartLoc, | ||
const DeclarationNameInfo & | NameInfo, | ||
QualType | T, | ||
TypeSourceInfo * | TInfo, | ||
bool | isInline, | ||
bool | isExplicit, | ||
bool | isConstexpr, | ||
SourceLocation | EndLocation | ||
) | [static] |
Definition at line 1902 of file DeclCXX.cpp.
References AttributeLangSupport::C, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationNameInfo::getName(), and clang::DeclarationName::getNameKind().
Referenced by addBlockPointerConversion(), addFunctionPointerConversion(), CreateNewFunctionDecl(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::ASTNodeImporter::VisitFunctionDecl().
CXXConversionDecl * CXXConversionDecl::CreateDeserialized | ( | ASTContext & | C, |
unsigned | ID | ||
) | [static] |
Reimplemented from clang::CXXMethodDecl.
Definition at line 1894 of file DeclCXX.cpp.
References AttributeLangSupport::C.
QualType clang::CXXConversionDecl::getConversionType | ( | ) | const [inline] |
Returns the type that this conversion function is converting to.
Definition at line 2437 of file DeclCXX.h.
References clang::Type::getAs(), clang::FunctionDecl::getReturnType(), and clang::ValueDecl::getType().
Referenced by clang::Sema::ActOnConversionDeclarator(), clang::Sema::AddConversionCandidate(), clang::Sema::BuildBlockForLambdaConversion(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildCXXMemberCallExpr(), compareConversionFunctions(), CompleteNonViableCandidate(), clang::Sema::DeduceTemplateArguments(), diagnoseAmbiguousConversion(), diagnoseNoViableConversion(), clang::OverloadCandidate::getNumParams(), isLambdaToBlockPointerConversion(), NoteSurrogateCandidate(), clang::Sema::PerformContextualImplicitConversion(), and recordConversion().
bool clang::CXXConversionDecl::isExplicit | ( | ) | const [inline] |
Whether this is an explicit conversion operator (C++11 and later).
Explicit conversion operators are only considered for direct initialization, e.g., when the user has explicitly written a cast.
Definition at line 2432 of file DeclCXX.h.
References clang::Redeclarable< FunctionDecl >::getFirstDecl(), and isExplicitSpecified().
Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::BuildCallToObjectOfClassType(), and clang::Sema::PerformContextualImplicitConversion().
bool clang::CXXConversionDecl::isExplicitSpecified | ( | ) | const [inline] |
Whether this conversion function declaration is marked "explicit", meaning that it can only be used for direct initialization (including explitly written casts). This is a C++11 feature.
Definition at line 2426 of file DeclCXX.h.
Referenced by isExplicit().
Determine whether this conversion function is a conversion from a lambda closure type to a block pointer.
Definition at line 1916 of file DeclCXX.cpp.
References getConversionType(), clang::CXXMethodDecl::getParent(), clang::Type::isBlockPointerType(), clang::Decl::isImplicit(), and clang::CXXRecordDecl::isLambda().
Referenced by clang::Sema::MarkFunctionReferenced().
friend class ASTDeclReader [friend] |
Reimplemented from clang::FunctionDecl.
friend class ASTDeclWriter [friend] |
Reimplemented from clang::FunctionDecl.