clang API Documentation

Public Member Functions | Static Public Member Functions | Protected Member Functions
clang::ExplicitCastExpr Class Reference

#include <Expr.h>

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

List of all members.

Public Member Functions

TypeSourceInfogetTypeInfoAsWritten () const
void setTypeInfoAsWritten (TypeSourceInfo *writtenTy)
QualType getTypeAsWritten () const

Static Public Member Functions

static bool classof (const Stmt *T)

Protected Member Functions

 ExplicitCastExpr (StmtClass SC, QualType exprTy, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, TypeSourceInfo *writtenTy)
 ExplicitCastExpr (StmtClass SC, EmptyShell Shell, unsigned PathSize)
 Construct an empty explicit cast.

Detailed Description

ExplicitCastExpr - An explicit cast written in the source code.

This class is effectively an abstract class, because it provides the basic representation of an explicitly-written cast without specifying which kind of cast (C cast, functional cast, static cast, etc.) was written; specific derived classes represent the particular style of cast and its location information.

Unlike implicit casts, explicit cast nodes have two different types: the type that was written into the source code, and the actual type of the expression as determined by semantic analysis. These types may differ slightly. For example, in C++ one can cast to a reference type, which indicates that the resulting expression will be an lvalue or xvalue. The reference type, however, will not be used as the type of the expression.

Definition at line 2825 of file Expr.h.


Constructor & Destructor Documentation

clang::ExplicitCastExpr::ExplicitCastExpr ( StmtClass  SC,
QualType  exprTy,
ExprValueKind  VK,
CastKind  kind,
Expr op,
unsigned  PathSize,
TypeSourceInfo writtenTy 
) [inline, protected]

Definition at line 2831 of file Expr.h.

clang::ExplicitCastExpr::ExplicitCastExpr ( StmtClass  SC,
EmptyShell  Shell,
unsigned  PathSize 
) [inline, protected]

Construct an empty explicit cast.

Definition at line 2837 of file Expr.h.


Member Function Documentation

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

getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code.

Definition at line 2848 of file Expr.h.

References clang::TypeSourceInfo::getType().

Referenced by clang::canDynamicCastThrow(), clang::Sema::checkUnknownAnyArg(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), clang::Expr::HasSideEffects(), and isIdenticalStmt().

getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.

Definition at line 2843 of file Expr.h.

Referenced by clang::CXXFunctionalCastExpr::getLocStart(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), and clang::ASTNodeImporter::VisitCStyleCastExpr().

Definition at line 2844 of file Expr.h.


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