| 36 | namespace { |
| 37 | |
| 38 | bool 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 |
no test coverage detected