clang API Documentation

Public Member Functions | Static Public Member Functions | Friends
clang::PackExpansionExpr Class Reference

Represents a C++0x pack expansion that produces a sequence of expressions. More...

#include <ExprCXX.h>

Inheritance diagram for clang::PackExpansionExpr:
Inheritance graph
[legend]
Collaboration diagram for clang::PackExpansionExpr:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PackExpansionExpr (QualType T, Expr *Pattern, SourceLocation EllipsisLoc, llvm::Optional< unsigned > NumExpansions)
 PackExpansionExpr (EmptyShell Empty)
ExprgetPattern ()
 Retrieve the pattern of the pack expansion.
const ExprgetPattern () const
 Retrieve the pattern of the pack expansion.
SourceLocation getEllipsisLoc () const
 Retrieve the location of the ellipsis that describes this pack expansion.
llvm::Optional< unsigned > getNumExpansions () const
 Determine the number of expansions that will be produced when this pack expansion is instantiated, if already known.
SourceRange getSourceRange () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static bool classof (const Stmt *T)
static bool classof (const PackExpansionExpr *)

Friends

class ASTStmtReader
class ASTStmtWriter

Detailed Description

Represents a C++0x pack expansion that produces a sequence of expressions.

A pack expansion expression contains a pattern (which itself is an expression) followed by an ellipsis. For example:

 template<typename F, typename ...Types>
 void forward(F f, Types &&...args) {
   f(static_cast<Types&&>(args)...);
 }

Here, the argument to the function object f is a pack expansion whose pattern is static_cast<Types&&>(args). When the forward function template is instantiated, the pack expansion will instantiate to zero or or more function arguments to the function object f.

Definition at line 3318 of file ExprCXX.h.


Constructor & Destructor Documentation

clang::PackExpansionExpr::PackExpansionExpr ( QualType  T,
Expr Pattern,
SourceLocation  EllipsisLoc,
llvm::Optional< unsigned >  NumExpansions 
) [inline]

Definition at line 3334 of file ExprCXX.h.

clang::PackExpansionExpr::PackExpansionExpr ( EmptyShell  Empty) [inline]

Definition at line 3344 of file ExprCXX.h.


Member Function Documentation

child_range clang::PackExpansionExpr::children ( ) [inline]

Reimplemented from clang::Stmt.

Definition at line 3375 of file ExprCXX.h.

static bool clang::PackExpansionExpr::classof ( const Stmt T) [inline, static]

Reimplemented from clang::Expr.

Definition at line 3369 of file ExprCXX.h.

References clang::Stmt::getStmtClass().

static bool clang::PackExpansionExpr::classof ( const PackExpansionExpr ) [inline, static]

Definition at line 3372 of file ExprCXX.h.

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

Retrieve the location of the ellipsis that describes this pack expansion.

Definition at line 3354 of file ExprCXX.h.

Referenced by clang::TemplateArgumentLoc::getPackExpansionPattern().

llvm::Optional<unsigned> clang::PackExpansionExpr::getNumExpansions ( ) const [inline]

Determine the number of expansions that will be produced when this pack expansion is instantiated, if already known.

Definition at line 3358 of file ExprCXX.h.

Referenced by clang::TemplateArgumentLoc::getPackExpansionPattern().

Expr* clang::PackExpansionExpr::getPattern ( ) [inline]

Retrieve the pattern of the pack expansion.

Definition at line 3347 of file ExprCXX.h.

Referenced by clang::TemplateArgumentLoc::getPackExpansionPattern().

const Expr* clang::PackExpansionExpr::getPattern ( ) const [inline]

Retrieve the pattern of the pack expansion.

Definition at line 3350 of file ExprCXX.h.

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

SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. We assume AST clients will have a pointer to the respective SourceManager.

Reimplemented from clang::Stmt.

Definition at line 3365 of file ExprCXX.h.

References clang::Stmt::getLocStart().


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 3330 of file ExprCXX.h.

friend class ASTStmtWriter [friend]

Reimplemented from clang::Stmt.

Definition at line 3331 of file ExprCXX.h.


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