MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / StaticCast

Function StaticCast

ASTHelpers.cpp:253–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251//-----------------------------------------------------------------------------
252
253CXXStaticCastExpr* StaticCast(QualType toType, const Expr* toExpr, bool makePointer)
254{
255 auto& ctx = GetGlobalAST();
256
257 QualType sourceInfoToType = makePointer ? Ptr(toType) : toType;
258 toType = toType.getNonReferenceType();
259
260 return CXXStaticCastExpr::Create(ctx,
261 toType,
262 VK_LValue,
263 CK_DerivedToBase,
264 const_cast<Expr*>(toExpr),
265 nullptr,
266 ctx.getTrivialTypeSourceInfo(sourceInfoToType),
267 {},
268 {},
269 {},
270 {});
271}
272//-----------------------------------------------------------------------------
273
274auto* mkLabelDecl(std::string_view name)

Callers 5

InsertArgMethod · 0.85
CastFunction · 0.85
CallConstructorFunction · 0.85
InsertArgMethod · 0.85
InsertCXXMethodDeclMethod · 0.85

Calls 1

PtrFunction · 0.85

Tested by

no test coverage detected