MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / isConstCast

Method isConstCast

src/ast/ast_unused.cpp:130–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128 propagateRead(at->index);
129 }
130 bool isConstCast ( const TypeDeclPtr & td ) const {
131 if ( td->constant ) return true; // cast<foo const> is const
132 if ( td->baseType==Type::tPointer ) {
133 if ( !td->firstType ) return true; // void? cast is ok
134 if ( td->firstType && td->firstType->constant ) return true; // cast<foo const?> is const
135 } else {
136 if ( !td->isRefType() ) return true; // cast<int> is const
137 }
138 return false;
139 }
140 void propagateRead ( Expression * expr ) {
141 if ( expr->rtti_isVar() ) {
142 auto var = (ExprVar *) expr;

Callers

nothing calls this directly

Calls 1

isRefTypeMethod · 0.45

Tested by

no test coverage detected