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

Function GetDesugarType

InsightsHelpers.cpp:297–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295//-----------------------------------------------------------------------------
296
297const QualType GetDesugarType(const QualType& QT)
298{
299 if(QT.getTypePtrOrNull()) {
300 if(const auto* autoType = QT->getAs<clang::AutoType>(); autoType and autoType->isSugared()) {
301 const auto dt = autoType->getDeducedType();
302
303 if(const auto* et = dt->getAs<ElaboratedType>()) {
304 return et->getNamedType();
305 } else {
306 return dt;
307 }
308
309 } else if(auto declType = QT->getAs<clang::DecltypeType>()) {
310 return declType->desugar();
311 }
312 }
313 return QT;
314}
315//-----------------------------------------------------------------------------
316
317static const VarDecl* GetVarDeclFromDeclRefExpr(const DeclRefExpr& declRefExpr)

Callers 5

GetDesugarReturnTypeFunction · 0.85
TypeContainsSubTypeFunction · 0.85
InsertArgMethod · 0.85
HasTypeWithSubTypeFunction · 0.85
HasTypePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected