clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions
clang::ImplicitCastExpr Class Reference

#include <Expr.h>

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

List of all members.

Public Types

enum  OnStack_t { OnStack }

Public Member Functions

 ImplicitCastExpr (OnStack_t _, QualType ty, CastKind kind, Expr *op, ExprValueKind VK)
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY

Static Public Member Functions

static ImplicitCastExprCreate (const ASTContext &Context, QualType T, CastKind Kind, Expr *Operand, const CXXCastPath *BasePath, ExprValueKind Cat)
static ImplicitCastExprCreateEmpty (const ASTContext &Context, unsigned PathSize)
static bool classof (const Stmt *T)

Detailed Description

ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct representation in the original source code. For example: converting T[]->T*, void f()->void (*f)(), float->double, short->int, etc.

In C, implicit casts always produce rvalues. However, in C++, an implicit cast whose result is being bound to a reference will be an lvalue or xvalue. For example:

 class Base { };
 class Derived : public Base { };
 Derived &&ref();
 void f(Derived d) {
   Base& b = d; // initializer is an ImplicitCastExpr
                // to an lvalue of type Base
   Base&& r = ref(); // initializer is an ImplicitCastExpr
                     // to an xvalue of type Base
 }

Definition at line 2764 of file Expr.h.


Member Enumeration Documentation

Enumerator:
OnStack 

Definition at line 2776 of file Expr.h.


Constructor & Destructor Documentation

clang::ImplicitCastExpr::ImplicitCastExpr ( OnStack_t  _,
QualType  ty,
CastKind  kind,
Expr op,
ExprValueKind  VK 
) [inline]

Definition at line 2777 of file Expr.h.


Member Function Documentation

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

Reimplemented from clang::CastExpr.

Definition at line 2797 of file Expr.h.

References clang::Stmt::getStmtClass().

ImplicitCastExpr * ImplicitCastExpr::Create ( const ASTContext Context,
QualType  T,
CastKind  Kind,
Expr Operand,
const CXXCastPath BasePath,
ExprValueKind  Cat 
) [static]
ImplicitCastExpr * ImplicitCastExpr::CreateEmpty ( const ASTContext Context,
unsigned  PathSize 
) [static]

Definition at line 1737 of file Expr.cpp.

References clang::ASTContext::Allocate().

Reimplemented from clang::Stmt.

Definition at line 2793 of file Expr.h.

References clang::Stmt::getLocEnd(), and clang::CastExpr::getSubExpr().

Reimplemented from clang::Stmt.

Definition at line 2790 of file Expr.h.

References clang::Stmt::getLocStart(), and clang::CastExpr::getSubExpr().


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