Skip to content

Commit 1c51c34

Browse files
authored
Merge pull request github#1700 from geoffw0/lambdacaptureelement
CPP: Make LambdaCaptures Elements
2 parents ec268c1 + fbeb797 commit 1c51c34

File tree

10 files changed

+4054
-148
lines changed

10 files changed

+4054
-148
lines changed

cpp/ql/src/semmle/code/cpp/exprs/Lambda.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ class Closure extends Class {
9898
/**
9999
* Information about a value captured as part of a lambda expression.
100100
*/
101-
class LambdaCapture extends @lambdacapture {
102-
string toString() {
101+
class LambdaCapture extends Locatable, @lambdacapture {
102+
override string toString() {
103103
result = getField().toString()
104104
}
105105

106-
string getCanonicalQLClass() { result = "LambdaCapture" }
106+
override string getCanonicalQLClass() { result = "LambdaCapture" }
107107

108108
/**
109109
* Holds if this capture was made implicitly.
@@ -133,7 +133,7 @@ class LambdaCapture extends @lambdacapture {
133133
* For implicit captures, this is the first ___location within the "{...}" part of the lambda
134134
* expression which accesses the captured variable.
135135
*/
136-
Location getLocation() {
136+
override Location getLocation() {
137137
lambda_capture(this, _, _, _, _, _, result)
138138
}
139139

cpp/ql/src/semmlecode.cpp.dbscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,8 @@ frienddecls(
10261026
| @namequalifier
10271027
| @specialnamequalifyingelement
10281028
| @static_assert
1029-
| @type_mention;
1029+
| @type_mention
1030+
| @lambdacapture;
10301031

10311032
@exprparent = @element;
10321033

0 commit comments

Comments
 (0)