C++: Implement Expr::mayBeFromImplicitlyDeclaredFunction

This commit is contained in:
Calum Grant
2024-10-16 10:23:39 +01:00
parent 853128c9c3
commit 6a48ad0ee7
11 changed files with 37 additions and 1 deletions

View File

@@ -300,6 +300,11 @@ class FunctionCall extends Call, @funbindexpr {
this.isVirtual() or
this.getTarget().getAnAttribute().getName() = "weak"
}
override predicate mayBeFromImplicitlyDeclaredFunction() {
this.getType() instanceof IntType and
this.getTarget().getADeclarationEntry().isImplicit()
}
}
/** A _user-defined_ unary `operator*` function. */

View File

@@ -534,6 +534,9 @@ class Expr extends StmtParent, @expr {
/** Gets the function containing this control-flow node. */
override Function getControlFlowScope() { result = this.getEnclosingFunction() }
/** Holds if this expression could be the return value of an implicitly declared function. */
predicate mayBeFromImplicitlyDeclaredFunction() { none() }
}
/**