clang API Documentation
Represents a prvalue temporary that written into memory so that a reference can bind to it. More...
#include <ExprCXX.h>


Public Member Functions | |
| MaterializeTemporaryExpr (QualType T, Expr *Temporary, bool BoundToLvalueReference) | |
| MaterializeTemporaryExpr (EmptyShell Empty) | |
| Expr * | GetTemporaryExpr () const |
| Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue. | |
| bool | isBoundToLvalueReference () const |
| Determine whether this materialized temporary is bound to an lvalue reference; otherwise, it's bound to an rvalue reference. | |
| SourceRange | getSourceRange () const LLVM_READONLY |
| child_range | children () |
Static Public Member Functions | |
| static bool | classof (const Stmt *T) |
| static bool | classof (const MaterializeTemporaryExpr *) |
Friends | |
| class | ASTStmtReader |
| class | ASTStmtWriter |
Represents a prvalue temporary that written into memory so that a reference can bind to it.
Prvalue expressions are materialized when they need to have an address in memory for a reference to bind to. This happens when binding a reference to the result of a conversion, e.g.,
const int &r = 1.0;
Here, 1.0 is implicitly converted to an int. That resulting int is then materialized via a MaterializeTemporaryExpr, and the reference binds to the temporary. MaterializeTemporaryExprs are always glvalues (either an lvalue or an xvalue, depending on the kind of reference binding to it), maintaining the invariant that references always bind to glvalues.
| clang::MaterializeTemporaryExpr::MaterializeTemporaryExpr | ( | EmptyShell | Empty | ) | [inline] |
| child_range clang::MaterializeTemporaryExpr::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
| static bool clang::MaterializeTemporaryExpr::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::Expr.
Definition at line 3642 of file ExprCXX.h.
References clang::Stmt::getStmtClass().
| static bool clang::MaterializeTemporaryExpr::classof | ( | const MaterializeTemporaryExpr * | ) | [inline, static] |
| SourceRange clang::MaterializeTemporaryExpr::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 3638 of file ExprCXX.h.
References clang::Stmt::getSourceRange().
| Expr* clang::MaterializeTemporaryExpr::GetTemporaryExpr | ( | ) | const [inline] |
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
Definition at line 3630 of file ExprCXX.h.
Referenced by clang::ento::ExprEngine::CreateCXXTemporaryObject().
| bool clang::MaterializeTemporaryExpr::isBoundToLvalueReference | ( | ) | const [inline] |
Determine whether this materialized temporary is bound to an lvalue reference; otherwise, it's bound to an rvalue reference.
Definition at line 3634 of file ExprCXX.h.
References clang::Expr::getValueKind(), and clang::VK_LValue.
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.
friend class ASTStmtWriter [friend] |
Reimplemented from clang::Stmt.