class CXXBaseSpecifier

Declaration

class CXXBaseSpecifier { /* full declaration omitted */ };

Description

Represents a base class of a C++ class. Each CXXBaseSpecifier represents a single, direct base class (or struct) of a C++ class (or struct). It specifies the type of that base class, whether it is a virtual or non-virtual base, and what level of access (public, protected, private) is used for the derivation. For example: In this code, C will have two CXXBaseSpecifiers, one for "public virtual A" and the other for "protected B".

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

Member Variables

private clang::SourceRange Range
The source code range that covers the full base specifier, including the "virtual" (if present) and access specifier (if present).
private clang::SourceLocation EllipsisLoc
The source location of the ellipsis, if this is a pack expansion.
private unsigned int Virtual
Whether this is a virtual base class or not.
private unsigned int BaseOfClass
This determines the mapping from the access specifier as written in the source code to the access specifier used for semantic analysis.
private unsigned int Access
The actual type of data stored here is an AccessSpecifier, but we use "unsigned" here to work around a VC++ bug.
private unsigned int InheritConstructors
Whether the class contains a using declaration to inherit the named class's constructors.
private clang::TypeSourceInfo* BaseTypeInfo
This will be a class or struct (or a typedef of such). The source code range does not include the \c virtual or the access specifier.

Method Overview

Methods

CXXBaseSpecifier()

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

CXXBaseSpecifier(
    clang::SourceRange R,
    bool V,
    bool BC,
    clang::AccessSpecifier A,
    clang::TypeSourceInfo* TInfo,
    clang::SourceLocation EllipsisLoc)

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

Parameters

clang::SourceRange R
bool V
bool BC
clang::AccessSpecifier A
clang::TypeSourceInfo* TInfo
clang::SourceLocation EllipsisLoc

clang::AccessSpecifier getAccessSpecifier() const

Description

Returns the access specifier for this base specifier. This is the actual base specifier as used for semantic analysis, so the result can never be AS_none. To retrieve the access specifier as written in the source code, use getAccessSpecifierAsWritten().

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

clang::AccessSpecifier
getAccessSpecifierAsWritten() const

Description

Retrieves the access specifier as written in the source code (which may mean that no access specifier was explicitly written). Use getAccessSpecifier() to retrieve the access specifier for use in semantic analysis.

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

clang::SourceLocation getBaseTypeLoc() const

Description

Get the location at which the base class type was written.

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

clang::SourceLocation getBeginLoc() const

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

clang::SourceLocation getEllipsisLoc() const

Description

For a pack expansion, determine the location of the ellipsis.

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

clang::SourceLocation getEndLoc() const

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

bool getInheritConstructors() const

Description

Determine whether this base class's constructors get inherited.

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

clang::SourceRange getSourceRange() const

Description

Retrieves the source range that contains the entire base specifier.

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

clang::QualType getType() const

Description

Retrieves the type of the base class. This type will always be an unqualified class type.

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

clang::TypeSourceInfo* getTypeSourceInfo() const

Description

Retrieves the type and source location of the base class.

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

bool isBaseOfClass() const

Description

Determine whether this base class is a base of a class declared with the 'class' keyword (vs. one declared with the 'struct' keyword).

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

bool isPackExpansion() const

Description

Determine whether this base specifier is a pack expansion.

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

bool isVirtual() const

Description

Determines whether the base class is a virtual base class (or not).

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

void setInheritConstructors(bool Inherit = true)

Description

Set that this base class's constructors should be inherited.

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

Parameters

bool Inherit = true