mirror of
https://github.com/github/codeql.git
synced 2026-04-20 14:34:04 +02:00
C++: Add predicates for lambda parameter list
This commit is contained in:
@@ -48,6 +48,19 @@ class LambdaExpression extends Expr, @lambdaexpr {
|
||||
*/
|
||||
predicate returnTypeIsExplicit() { lambdas(underlyingElement(this), _, true, _) }
|
||||
|
||||
/**
|
||||
* Holds if the lambda has an explicitly specified parameter list, even when empty.
|
||||
*/
|
||||
predicate hasParameterList() { lambdas(underlyingElement(this), _, _, true) }
|
||||
|
||||
/**
|
||||
* Holds if the lambda has an empty parameter list
|
||||
*/
|
||||
predicate emptyParameterListIsExplicit() {
|
||||
this.hasParameterList() and
|
||||
this.getLambdaFunction().getNumberOfParameters() = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the function which will be invoked when the resulting object is called.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user