clang API Documentation

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

Represents a C++11 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, 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.
Optional< unsignedgetNumExpansions () const
 Determine the number of expansions that will be produced when this pack expansion is instantiated, if already known.
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static bool classof (const Stmt *T)

Friends

class ASTStmtReader
class ASTStmtWriter

Detailed Description

Represents a C++11 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 3378 of file ExprCXX.h.


Constructor & Destructor Documentation

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

Definition at line 3394 of file ExprCXX.h.

Definition at line 3404 of file ExprCXX.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 3435 of file ExprCXX.h.

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

Reimplemented from clang::Expr.

Definition at line 3430 of file ExprCXX.h.

References clang::Stmt::getStmtClass().

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

Definition at line 3414 of file ExprCXX.h.

Referenced by clang::Sema::getTemplateArgumentPackExpansionPattern().

Reimplemented from clang::Stmt.

Definition at line 3428 of file ExprCXX.h.

Reimplemented from clang::Stmt.

Definition at line 3425 of file ExprCXX.h.

References clang::Stmt::getLocStart().

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

Definition at line 3418 of file ExprCXX.h.

Referenced by clang::Sema::getTemplateArgumentPackExpansionPattern().

Retrieve the pattern of the pack expansion.

Definition at line 3407 of file ExprCXX.h.

Referenced by clang::Sema::getTemplateArgumentPackExpansionPattern().

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

Retrieve the pattern of the pack expansion.

Definition at line 3410 of file ExprCXX.h.


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 3390 of file ExprCXX.h.

friend class ASTStmtWriter [friend]

Reimplemented from clang::Stmt.

Definition at line 3391 of file ExprCXX.h.


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