clang API Documentation

Public Member Functions
clang::CXXBaseSpecifier Class Reference

#include <DeclCXX.h>

List of all members.

Public Member Functions

 CXXBaseSpecifier ()
 CXXBaseSpecifier (SourceRange R, bool V, bool BC, AccessSpecifier A, TypeSourceInfo *TInfo, SourceLocation EllipsisLoc)
SourceRange getSourceRange () const
bool isVirtual () const
bool isBaseOfClass () const
 Determine whether this base class is a base of a class declared with the 'class' keyword (vs. one declared with the 'struct' keyword).
bool isPackExpansion () const
 Determine whether this base specifier is a pack expansion.
bool getInheritConstructors () const
 Determine whether this base class's constructors get inherited.
void setInheritConstructors (bool Inherit=true)
 Set that this base class's constructors should be inherited.
SourceLocation getEllipsisLoc () const
 For a pack expansion, determine the location of the ellipsis.
AccessSpecifier getAccessSpecifier () const
AccessSpecifier getAccessSpecifierAsWritten () const
QualType getType () const
TypeSourceInfogetTypeSourceInfo () const
 getTypeLoc - Retrieves the type and source location of the base class.

Detailed Description

CXXBaseSpecifier - 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 164 of file DeclCXX.h.


Constructor & Destructor Documentation

clang::CXXBaseSpecifier::CXXBaseSpecifier ( ) [inline]

Definition at line 199 of file DeclCXX.h.

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

Definition at line 201 of file DeclCXX.h.


Member Function Documentation

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

getAccessSpecifier - 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 239 of file DeclCXX.h.

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

Referenced by CanUseSingleInheritance(), and DiagnoseAccessPath().

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

getAccessSpecifierAsWritten - 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::ASTWriter::AddCXXBaseSpecifier(), and DiagnoseAccessPath().

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

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

Definition at line 230 of file DeclCXX.h.

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

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

Determine whether this base class's constructors get inherited.

Definition at line 222 of file DeclCXX.h.

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

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

getSourceRange - Retrieves the source range that contains the entire base specifier.

Definition at line 208 of file DeclCXX.h.

Referenced by clang::ASTWriter::AddCXXBaseSpecifier(), clang::Sema::AttachBaseSpecifiers(), DiagnoseAccessPath(), and IsStructurallyEquivalent().

QualType clang::CXXBaseSpecifier::getType ( ) const [inline]
TypeSourceInfo* clang::CXXBaseSpecifier::getTypeSourceInfo ( ) const [inline]

getTypeLoc - Retrieves the type and source location of the base class.

Definition at line 259 of file DeclCXX.h.

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

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 216 of file DeclCXX.h.

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

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

Determine whether this base specifier is a pack expansion.

Definition at line 219 of file DeclCXX.h.

References clang::SourceLocation::isValid().

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

bool clang::CXXBaseSpecifier::isVirtual ( ) const [inline]
void clang::CXXBaseSpecifier::setInheritConstructors ( bool  Inherit = true) [inline]

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

Definition at line 225 of file DeclCXX.h.

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


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