C++: Only report implicit destructors if we need to translate them.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-04-04 11:13:52 +01:00
parent d4e2d37311
commit a756f14e77

View File

@@ -92,13 +92,17 @@ abstract class TranslatedExpr extends TranslatedElement {
or
exists(int maxChildId, int destructorIndex |
maxChildId = max(int childId | exists(this.getChildInternal(childId))) and
result.(TranslatedExpr).getExpr() = expr.getImplicitDestructorCall(destructorIndex) and
result = this.getImplicitDestructorCall(destructorIndex) and
id = maxChildId + 1 + destructorIndex
)
}
final private TranslatedExpr getImplicitDestructorCall(int index) {
result.getExpr() = expr.getImplicitDestructorCall(index)
}
final override predicate hasAnImplicitDestructorCall() {
exists(expr.getAnImplicitDestructorCall())
exists(this.getImplicitDestructorCall(_))
}
final override int getFirstDestructorCallIndex() {