class ExplicitCastExpr

Declaration

class ExplicitCastExpr : public CastExpr { /* full declaration omitted */ };

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.

Declared at: clang/include/clang/AST/Expr.h:3697

Inherits from: CastExpr

Member Variables

private clang::TypeSourceInfo* TInfo
TInfo - Source type info for the (written) type this expression is casting to.

Inherited from Stmt:

protected

Method Overview

  • protected ExplicitCastExpr(clang::Stmt::StmtClass SC, clang::QualType exprTy, clang::ExprValueKind VK, clang::CastKind kind, clang::Expr * op, unsigned int PathSize, bool HasFPFeatures, clang::TypeSourceInfo * writtenTy)
  • protected ExplicitCastExpr(clang::Stmt::StmtClass SC, clang::Stmt::EmptyShell Shell, unsigned int PathSize, bool HasFPFeatures)
  • public static bool classof(const clang::Stmt * T)
  • public clang::QualType getTypeAsWritten() const
  • public clang::TypeSourceInfo * getTypeInfoAsWritten() const
  • public void setTypeInfoAsWritten(clang::TypeSourceInfo * writtenTy)

Inherited from CastExpr:

Inherited from Expr:

Inherited from ValueStmt:

Inherited from Stmt:

Methods

ExplicitCastExpr(clang::Stmt::StmtClass SC,
                 clang::QualType exprTy,
                 clang::ExprValueKind VK,
                 clang::CastKind kind,
                 clang::Expr* op,
                 unsigned int PathSize,
                 bool HasFPFeatures,
                 clang::TypeSourceInfo* writtenTy)

Declared at: clang/include/clang/AST/Expr.h:3703

Parameters

clang::Stmt::StmtClass SC
clang::QualType exprTy
clang::ExprValueKind VK
clang::CastKind kind
clang::Expr* op
unsigned int PathSize
bool HasFPFeatures
clang::TypeSourceInfo* writtenTy

ExplicitCastExpr(clang::Stmt::StmtClass SC,
                 clang::Stmt::EmptyShell Shell,
                 unsigned int PathSize,
                 bool HasFPFeatures)

Description

Construct an empty explicit cast.

Declared at: clang/include/clang/AST/Expr.h:3712

Parameters

clang::Stmt::StmtClass SC
clang::Stmt::EmptyShell Shell
unsigned int PathSize
bool HasFPFeatures

static bool classof(const clang::Stmt* T)

Declared at: clang/include/clang/AST/Expr.h:3726

Parameters

const clang::Stmt* T

clang::QualType getTypeAsWritten() const

Description

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

Declared at: clang/include/clang/AST/Expr.h:3724

clang::TypeSourceInfo* getTypeInfoAsWritten()
    const

Description

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

Declared at: clang/include/clang/AST/Expr.h:3719

void setTypeInfoAsWritten(
    clang::TypeSourceInfo* writtenTy)

Declared at: clang/include/clang/AST/Expr.h:3720

Parameters

clang::TypeSourceInfo* writtenTy