MCPcopy Create free account
hub / github.com/KDE/kdevelop / isDestructor

Function isDestructor

plugins/clang/codegen/clangrefactoring.cpp:38–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36namespace {
37
38bool isDestructor(Declaration* decl)
39{
40 if (auto functionDef = dynamic_cast<FunctionDefinition*>(decl)) {
41 // we found a definition, e.g. "Foo::~Foo()"
42 const auto functionDecl = functionDef->declaration(decl->topContext());
43 if (auto classFunctionDecl = dynamic_cast<ClassFunctionDeclaration*>(functionDecl)) {
44 return classFunctionDecl->isDestructor();
45 }
46 }
47 else if (auto classFunctionDecl = dynamic_cast<ClassFunctionDeclaration*>(decl)) {
48 // we found a declaration, e.g. "~Foo()"
49 return classFunctionDecl->isDestructor();
50 }
51
52 return false;
53}
54
55}
56

Callers 1

Calls 3

isDestructorMethod · 0.80
declarationMethod · 0.45
topContextMethod · 0.45

Tested by

no test coverage detected