class CXXConstructorDecl

Declaration

class CXXConstructorDecl : public CXXMethodDecl,
                           private TrailingObjects { /* full declaration omitted */ };

Description

Represents a C++ constructor within a class. For example:

Declared at: clang/include/clang/AST/DeclCXX.h:2434

Inherits from: CXXMethodDecl, TrailingObjects

Member Variables

private clang::LazyCXXCtorInitializersPtr CtorInitializers
\ { The arguments used to initialize the base or member.

Inherited from DeclContext:

protected
protected FirstDecl = nullptr
protected LastDecl = nullptr

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

Inherited from CXXMethodDecl:

Inherited from FunctionDecl:

Inherited from DeclContext:

Inherited from DeclaratorDecl:

Inherited from ValueDecl:

Inherited from NamedDecl:

Inherited from Decl:

Methods

CXXConstructorDecl(
    clang::ASTContext& C,
    clang::CXXRecordDecl* RD,
    clang::SourceLocation StartLoc,
    const clang::DeclarationNameInfo& NameInfo,
    clang::QualType T,
    clang::TypeSourceInfo* TInfo,
    clang::ExplicitSpecifier ES,
    bool UsesFPIntrin,
    bool isInline,
    bool isImplicitlyDeclared,
    clang::ConstexprSpecKind ConstexprKind,
    clang::InheritedConstructor Inherited,
    clang::Expr* TrailingRequiresClause)

Declared at: clang/include/clang/AST/DeclCXX.h:2446

Parameters

clang::ASTContext& C
clang::CXXRecordDecl* RD
clang::SourceLocation StartLoc
const clang::DeclarationNameInfo& NameInfo
clang::QualType T
clang::TypeSourceInfo* TInfo
clang::ExplicitSpecifier ES
bool UsesFPIntrin
bool isInline
bool isImplicitlyDeclared
clang::ConstexprSpecKind ConstexprKind
clang::InheritedConstructor Inherited
clang::Expr* TrailingRequiresClause

static clang::CXXConstructorDecl* Create(
    clang::ASTContext& C,
    clang::CXXRecordDecl* RD,
    clang::SourceLocation StartLoc,
    const clang::DeclarationNameInfo& NameInfo,
    clang::QualType T,
    clang::TypeSourceInfo* TInfo,
    clang::ExplicitSpecifier ES,
    bool UsesFPIntrin,
    bool isInline,
    bool isImplicitlyDeclared,
    clang::ConstexprSpecKind ConstexprKind,
    clang::InheritedConstructor Inherited =
        clang::InheritedConstructor(),
    clang::Expr* TrailingRequiresClause = nullptr)

Declared at: clang/include/clang/AST/DeclCXX.h:2490

Parameters

clang::ASTContext& C
clang::CXXRecordDecl* RD
clang::SourceLocation StartLoc
const clang::DeclarationNameInfo& NameInfo
clang::QualType T
clang::TypeSourceInfo* TInfo
clang::ExplicitSpecifier ES
bool UsesFPIntrin
bool isInline
bool isImplicitlyDeclared
clang::ConstexprSpecKind ConstexprKind
clang::InheritedConstructor Inherited = clang::InheritedConstructor()
clang::Expr* TrailingRequiresClause = nullptr

static clang::CXXConstructorDecl*
CreateDeserialized(clang::ASTContext& C,
                   unsigned int ID,
                   uint64_t AllocKind)

Declared at: clang/include/clang/AST/DeclCXX.h:2487

Parameters

clang::ASTContext& C
unsigned int ID
uint64_t AllocKind

void anchor()

Declared at: clang/include/clang/AST/DeclCXX.h:2454

static bool classof(const clang::Decl* D)

Declared at: clang/include/clang/AST/DeclCXX.h:2687

Parameters

const clang::Decl* D

static bool classofKind(clang::Decl::Kind K)

Declared at: clang/include/clang/AST/DeclCXX.h:2688

Parameters

clang::Decl::Kind K

clang::CXXConstructorDecl* getCanonicalDecl()

Description

Retrieves the "canonical" declaration of the given declaration.

Declared at: clang/include/clang/AST/DeclCXX.h:2679

const clang::CXXConstructorDecl*
getCanonicalDecl() const

Declared at: clang/include/clang/AST/DeclCXX.h:2682

clang::ExplicitSpecifier getExplicitSpecifier()

Declared at: clang/include/clang/AST/DeclCXX.h:2508

const clang::ExplicitSpecifier
getExplicitSpecifier() const

Declared at: clang/include/clang/AST/DeclCXX.h:2511

clang::ExplicitSpecifier
getExplicitSpecifierInternal() const

Declared at: clang/include/clang/AST/DeclCXX.h:2463

clang::InheritedConstructor
getInheritedConstructor() const

Description

Get the constructor that this inheriting constructor is based on.

Declared at: clang/include/clang/AST/DeclCXX.h:2674

unsigned int getNumCtorInitializers() const

Description

Determine the number of arguments used to initialize the member or base.

Declared at: clang/include/clang/AST/DeclCXX.h:2571

clang::CXXConstructorDecl* getTargetConstructor()
    const

Description

When this constructor delegates to another, retrieve the target.

Declared at: clang/include/clang/AST/DeclCXX.h:2595

uint64_t getTrailingAllocKind() const

Declared at: clang/include/clang/AST/DeclCXX.h:2477

clang::CXXConstructorDecl::init_iterator
init_begin()

Description

Retrieve an iterator to the first initializer.

Declared at: clang/include/clang/AST/DeclCXX.h:2533

clang::CXXConstructorDecl::init_const_iterator
init_begin() const

Description

Retrieve an iterator to the first initializer.

Declared at: clang/include/clang/AST/DeclCXX.h:2539

clang::CXXConstructorDecl::init_iterator
init_end()

Description

Retrieve an iterator past the last initializer.

Declared at: clang/include/clang/AST/DeclCXX.h:2542

clang::CXXConstructorDecl::init_const_iterator
init_end() const

Description

Retrieve an iterator past the last initializer.

Declared at: clang/include/clang/AST/DeclCXX.h:2547

clang::CXXConstructorDecl::init_reverse_iterator
init_rbegin()

Declared at: clang/include/clang/AST/DeclCXX.h:2555

clang::CXXConstructorDecl::
    init_const_reverse_iterator
    init_rbegin() const

Declared at: clang/include/clang/AST/DeclCXX.h:2558

clang::CXXConstructorDecl::init_reverse_iterator
init_rend()

Declared at: clang/include/clang/AST/DeclCXX.h:2562

clang::CXXConstructorDecl::
    init_const_reverse_iterator
    init_rend() const

Declared at: clang/include/clang/AST/DeclCXX.h:2565

clang::CXXConstructorDecl::init_const_range
inits() const

Declared at: clang/include/clang/AST/DeclCXX.h:2528

clang::CXXConstructorDecl::init_range inits()

Declared at: clang/include/clang/AST/DeclCXX.h:2527

bool isConvertingConstructor(
    bool AllowExplicit) const

Description

Whether this constructor is a converting constructor (C++ [class.conv.ctor]), which can be used for user-defined conversions.

Declared at: clang/include/clang/AST/DeclCXX.h:2654

Parameters

bool AllowExplicit

bool isCopyConstructor(
    unsigned int& TypeQuals) const

Description

Whether this constructor is a copy constructor (C++ [class.copy]p2, which can be used to copy the class. \p TypeQuals will be set to the qualifiers on the argument type. For example, \p TypeQuals would be set to \c Qualifiers::Const for the following copy constructor:

Declared at: clang/include/clang/AST/DeclCXX.h:2615

Parameters

unsigned int& TypeQuals

bool isCopyConstructor() const

Description

Whether this constructor is a copy constructor (C++ [class.copy]p2, which can be used to copy the class.

Declared at: clang/include/clang/AST/DeclCXX.h:2620

bool isCopyOrMoveConstructor() const

Description

Determine whether this a copy or move constructor.

Declared at: clang/include/clang/AST/DeclCXX.h:2646

bool isCopyOrMoveConstructor(
    unsigned int& TypeQuals) const

Description

Determine whether this is a copy or move constructor.

Declared at: clang/include/clang/AST/DeclCXX.h:2643

Parameters

unsigned int& TypeQuals
Will be set to the type qualifiers on the reference parameter, if in fact this is a copy or move constructor.

bool isDefaultConstructor() const

Description

Whether this constructor is a default constructor (C++ [class.ctor]p5), which can be used to default-initialize a class of this type.

Declared at: clang/include/clang/AST/DeclCXX.h:2600

bool isDelegatingConstructor() const

Description

Determine whether this constructor is a delegating constructor.

Declared at: clang/include/clang/AST/DeclCXX.h:2589

bool isExplicit() const

Description

Return true if the declartion is already resolved to be explicit.

Declared at: clang/include/clang/AST/DeclCXX.h:2516

bool isInheritingConstructor() const

Description

Determine whether this is an implicit constructor synthesized to model a call to a constructor inherited from a base class.

Declared at: clang/include/clang/AST/DeclCXX.h:2663

bool isMoveConstructor() const

Description

Determine whether this constructor is a move constructor (C++11 [class.copy]p3), which can be used to move values of the class.

Declared at: clang/include/clang/AST/DeclCXX.h:2634

bool isMoveConstructor(
    unsigned int& TypeQuals) const

Description

Determine whether this constructor is a move constructor (C++11 [class.copy]p3), which can be used to move values of the class.

Declared at: clang/include/clang/AST/DeclCXX.h:2630

Parameters

unsigned int& TypeQuals
If this constructor is a move constructor, will be set to the type qualifiers on the referent of the first parameter's type.

bool isSpecializationCopyingObject() const

Description

Determine whether this is a member template specialization that would copy the object to itself. Such constructors are never used to copy an object.

Declared at: clang/include/clang/AST/DeclCXX.h:2659

size_t numTrailingObjects(
    OverloadToken<clang::ExplicitSpecifier>) const

Declared at: clang/include/clang/AST/DeclCXX.h:2459

Parameters

OverloadToken<clang::ExplicitSpecifier>

size_t numTrailingObjects(
    OverloadToken<clang::InheritedConstructor>)
    const

Declared at: clang/include/clang/AST/DeclCXX.h:2456

Parameters

OverloadToken<clang::InheritedConstructor>

void setCtorInitializers(
    clang::CXXCtorInitializer** Initializers)

Declared at: clang/include/clang/AST/DeclCXX.h:2584

Parameters

clang::CXXCtorInitializer** Initializers

void setExplicitSpecifier(
    clang::ExplicitSpecifier ES)

Declared at: clang/include/clang/AST/DeclCXX.h:2497

Parameters

clang::ExplicitSpecifier ES

void setInheritingConstructor(bool isIC = true)

Description

State that this is an implicit constructor synthesized to model a call to a constructor inherited from a base class.

Declared at: clang/include/clang/AST/DeclCXX.h:2669

Parameters

bool isIC = true

void setNumCtorInitializers(
    unsigned int numCtorInitializers)

Declared at: clang/include/clang/AST/DeclCXX.h:2575

Parameters

unsigned int numCtorInitializers