clang API Documentation

Public Member Functions | Static Public Member Functions
clang::CXXBindTemporaryExpr Class Reference

Represents binding an expression to a temporary. More...

#include <ExprCXX.h>

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

List of all members.

Public Member Functions

 CXXBindTemporaryExpr (EmptyShell Empty)
CXXTemporarygetTemporary ()
const CXXTemporarygetTemporary () const
void setTemporary (CXXTemporary *T)
const ExprgetSubExpr () const
ExprgetSubExpr ()
void setSubExpr (Expr *E)
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static CXXBindTemporaryExprCreate (const ASTContext &C, CXXTemporary *Temp, Expr *SubExpr)
static bool classof (const Stmt *T)

Detailed Description

Represents binding an expression to a temporary.

This ensures the destructor is called for the temporary. It should only be needed for non-POD, non-trivially destructable class types. For example:

   struct S {
     S() { }  // User defined constructor makes S non-POD.
     ~S() { } // User defined destructor makes it non-trivial.
   };
   void test() {
     const S &s_ref = S(); // Requires a CXXBindTemporaryExpr.
   }

Definition at line 1025 of file ExprCXX.h.


Constructor & Destructor Documentation

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

Definition at line 1039 of file ExprCXX.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 1064 of file ExprCXX.h.

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

Reimplemented from clang::Expr.

Definition at line 1059 of file ExprCXX.h.

References clang::Stmt::getStmtClass().

CXXBindTemporaryExpr * CXXBindTemporaryExpr::Create ( const ASTContext C,
CXXTemporary Temp,
Expr SubExpr 
) [static]

Reimplemented from clang::Stmt.

Definition at line 1056 of file ExprCXX.h.

References clang::Stmt::getLocEnd().

Reimplemented from clang::Stmt.

Definition at line 1053 of file ExprCXX.h.

References clang::Stmt::getLocStart().

const Expr* clang::CXXBindTemporaryExpr::getSubExpr ( ) const [inline]

Definition at line 1050 of file ExprCXX.h.

Definition at line 1046 of file ExprCXX.h.

Definition at line 1051 of file ExprCXX.h.

Definition at line 1047 of file ExprCXX.h.


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