clang  6.0.0svn
Public Member Functions | List of all members
clang::CXXBaseSpecifier Class Reference

Represents a base class of a C++ class. More...

#include "clang/AST/DeclCXX.h"

Public Member Functions

 CXXBaseSpecifier ()
 
 CXXBaseSpecifier (SourceRange R, bool V, bool BC, AccessSpecifier A, TypeSourceInfo *TInfo, SourceLocation EllipsisLoc)
 
SourceRange getSourceRange () const LLVM_READONLY
 Retrieves the source range that contains the entire base specifier. More...
 
SourceLocation getLocStart () const LLVM_READONLY
 
SourceLocation getLocEnd () const LLVM_READONLY
 
SourceLocation getBaseTypeLoc () const LLVM_READONLY
 Get the location at which the base class type was written. More...
 
bool isVirtual () const
 Determines whether the base class is a virtual base class (or not). More...
 
bool isBaseOfClass () const
 Determine whether this base class is a base of a class declared with the 'class' keyword (vs. More...
 
bool isPackExpansion () const
 Determine whether this base specifier is a pack expansion. More...
 
bool getInheritConstructors () const
 Determine whether this base class's constructors get inherited. More...
 
void setInheritConstructors (bool Inherit=true)
 Set that this base class's constructors should be inherited. More...
 
SourceLocation getEllipsisLoc () const
 For a pack expansion, determine the location of the ellipsis. More...
 
AccessSpecifier getAccessSpecifier () const
 Returns the access specifier for this base specifier. More...
 
AccessSpecifier getAccessSpecifierAsWritten () const
 Retrieves the access specifier as written in the source code (which may mean that no access specifier was explicitly written). More...
 
QualType getType () const
 Retrieves the type of the base class. More...
 
TypeSourceInfogetTypeSourceInfo () const
 Retrieves the type and source location of the base class. More...
 

Detailed 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:

class A { };
class B { };
class C : public virtual A, protected B { };

In this code, C will have two CXXBaseSpecifiers, one for "public virtual A" and the other for "protected B".

Definition at line 157 of file DeclCXX.h.

Constructor & Destructor Documentation

◆ CXXBaseSpecifier() [1/2]

clang::CXXBaseSpecifier::CXXBaseSpecifier ( )
inline

Definition at line 193 of file DeclCXX.h.

◆ CXXBaseSpecifier() [2/2]

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

Definition at line 195 of file DeclCXX.h.

Member Function Documentation

◆ getAccessSpecifier()

AccessSpecifier clang::CXXBaseSpecifier::getAccessSpecifier ( ) const
inline

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().

Definition at line 238 of file DeclCXX.h.

References clang::AS_none, clang::AS_private, and clang::AS_public.

Referenced by CanUseSingleInheritance(), getTypeInfoVTable(), and clang::CXXRecordDecl::setBases().

◆ getAccessSpecifierAsWritten()

AccessSpecifier clang::CXXBaseSpecifier::getAccessSpecifierAsWritten ( ) const
inline

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.

Definition at line 250 of file DeclCXX.h.

Referenced by clang::ASTRecordWriter::AddCXXBaseSpecifier(), and clang::ASTImporter::Import().

◆ getBaseTypeLoc()

SourceLocation clang::CXXBaseSpecifier::getBaseTypeLoc ( ) const
inline

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

Definition at line 206 of file DeclCXX.h.

References clang::TypeLoc::getLocStart(), and clang::TypeSourceInfo::getTypeLoc().

◆ getEllipsisLoc()

SourceLocation clang::CXXBaseSpecifier::getEllipsisLoc ( ) const
inline

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

Definition at line 229 of file DeclCXX.h.

Referenced by clang::ASTRecordWriter::AddCXXBaseSpecifier(), and clang::ASTImporter::Import().

◆ getInheritConstructors()

bool clang::CXXBaseSpecifier::getInheritConstructors ( ) const
inline

Determine whether this base class's constructors get inherited.

Definition at line 221 of file DeclCXX.h.

Referenced by clang::ASTRecordWriter::AddCXXBaseSpecifier().

◆ getLocEnd()

SourceLocation clang::CXXBaseSpecifier::getLocEnd ( ) const
inline

Definition at line 203 of file DeclCXX.h.

References clang::SourceRange::getEnd().

◆ getLocStart()

SourceLocation clang::CXXBaseSpecifier::getLocStart ( ) const
inline

Definition at line 202 of file DeclCXX.h.

References clang::SourceRange::getBegin().

Referenced by checkMoveAssignmentForRepeatedMove().

◆ getSourceRange()

SourceRange clang::CXXBaseSpecifier::getSourceRange ( ) const
inline

Retrieves the source range that contains the entire base specifier.

Definition at line 201 of file DeclCXX.h.

Referenced by clang::ASTRecordWriter::AddCXXBaseSpecifier(), checkMoveAssignmentForRepeatedMove(), and clang::ASTImporter::Import().

◆ getType()

QualType clang::CXXBaseSpecifier::getType ( ) const
inline

◆ getTypeSourceInfo()

TypeSourceInfo* clang::CXXBaseSpecifier::getTypeSourceInfo ( ) const
inline

Retrieves the type and source location of the base class.

Definition at line 262 of file DeclCXX.h.

Referenced by clang::ASTRecordWriter::AddCXXBaseSpecifier(), and clang::ASTImporter::Import().

◆ isBaseOfClass()

bool clang::CXXBaseSpecifier::isBaseOfClass ( ) const
inline

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

one declared with the 'struct' keyword).

Definition at line 215 of file DeclCXX.h.

Referenced by clang::ASTRecordWriter::AddCXXBaseSpecifier(), and clang::ASTImporter::Import().

◆ isPackExpansion()

bool clang::CXXBaseSpecifier::isPackExpansion ( ) const
inline

Determine whether this base specifier is a pack expansion.

Definition at line 218 of file DeclCXX.h.

References clang::SourceLocation::isValid().

Referenced by clang::ASTRecordWriter::AddCXXBaseSpecifier().

◆ isVirtual()

bool clang::CXXBaseSpecifier::isVirtual ( ) const
inline

◆ setInheritConstructors()

void clang::CXXBaseSpecifier::setInheritConstructors ( bool  Inherit = true)
inline

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

Definition at line 224 of file DeclCXX.h.

Referenced by clang::Sema::CheckInheritingConstructorUsingDecl(), and clang::ASTReader::ReadCXXBaseSpecifier().


The documentation for this class was generated from the following file: