Skip to content

Commit d65b9ef

Browse files
authored
Merge pull request github#12661 from geoffw0/elementstests
C++: Restrict tests that output all elements
2 parents 977f15f + 202a717 commit d65b9ef

File tree

8 files changed

+48
-229
lines changed

8 files changed

+48
-229
lines changed
Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,21 @@
1-
| CPP-205.cpp:0:0:0:0 | CPP-205.cpp | |
2-
| CPP-205.cpp:1:20:1:20 | T | |
3-
| CPP-205.cpp:1:20:1:20 | definition of T | |
4-
| CPP-205.cpp:2:5:2:5 | definition of fn | function declaration entry for int fn<int>(int) |
5-
| CPP-205.cpp:2:5:2:5 | fn | function int fn<int>(int) |
6-
| CPP-205.cpp:2:5:2:6 | definition of fn | function declaration entry for int fn<T>(T) |
7-
| CPP-205.cpp:2:5:2:6 | fn | function int fn<T>(T) |
8-
| CPP-205.cpp:2:10:2:12 | definition of out | parameter declaration entry for int fn<T>(T) |
9-
| CPP-205.cpp:2:10:2:12 | definition of out | parameter declaration entry for int fn<int>(int) |
10-
| CPP-205.cpp:2:10:2:12 | out | parameter for int fn<T>(T) |
11-
| CPP-205.cpp:2:10:2:12 | out | parameter for int fn<int>(int) |
12-
| CPP-205.cpp:2:15:5:1 | { ... } | |
13-
| CPP-205.cpp:2:15:5:1 | { ... } | |
14-
| CPP-205.cpp:3:3:3:33 | declaration | |
15-
| CPP-205.cpp:3:3:3:33 | declaration | |
16-
| CPP-205.cpp:3:15:3:15 | declaration of y | |
17-
| CPP-205.cpp:3:15:3:15 | y | |
18-
| CPP-205.cpp:3:17:3:31 | 5 | |
19-
| CPP-205.cpp:4:3:4:11 | return ... | |
20-
| CPP-205.cpp:4:3:4:11 | return ... | |
21-
| CPP-205.cpp:4:10:4:10 | 0 | |
22-
| CPP-205.cpp:4:10:4:10 | 0 | |
1+
| CPP-205.cpp:2:5:2:5 | definition of fn | function declaration entry for int fn<int>(int), isFromTemplateInstantiation(fn) |
2+
| CPP-205.cpp:2:5:2:5 | fn | function int fn<int>(int), isFromTemplateInstantiation(fn) |
3+
| CPP-205.cpp:2:5:2:6 | definition of fn | function declaration entry for int fn<T>(T), isFromUninstantiatedTemplate(fn) |
4+
| CPP-205.cpp:2:5:2:6 | fn | function int fn<T>(T), isFromUninstantiatedTemplate(fn) |
5+
| CPP-205.cpp:2:10:2:12 | definition of out | isFromTemplateInstantiation(fn), parameter declaration entry for int fn<int>(int) |
6+
| CPP-205.cpp:2:10:2:12 | definition of out | isFromUninstantiatedTemplate(fn), parameter declaration entry for int fn<T>(T) |
7+
| CPP-205.cpp:2:10:2:12 | out | isFromTemplateInstantiation(fn), parameter for int fn<int>(int) |
8+
| CPP-205.cpp:2:10:2:12 | out | isFromUninstantiatedTemplate(fn), parameter for int fn<T>(T) |
9+
| CPP-205.cpp:2:15:5:1 | { ... } | isFromTemplateInstantiation(fn) |
10+
| CPP-205.cpp:2:15:5:1 | { ... } | isFromUninstantiatedTemplate(fn) |
11+
| CPP-205.cpp:3:3:3:33 | declaration | isFromTemplateInstantiation(fn) |
12+
| CPP-205.cpp:3:3:3:33 | declaration | isFromUninstantiatedTemplate(fn) |
13+
| CPP-205.cpp:3:15:3:15 | declaration of y | isFromUninstantiatedTemplate(fn) |
14+
| CPP-205.cpp:3:15:3:15 | y | isFromUninstantiatedTemplate(fn) |
15+
| CPP-205.cpp:3:17:3:31 | 5 | isFromTemplateInstantiation(fn) |
16+
| CPP-205.cpp:4:3:4:11 | return ... | isFromTemplateInstantiation(fn) |
17+
| CPP-205.cpp:4:3:4:11 | return ... | isFromUninstantiatedTemplate(fn) |
18+
| CPP-205.cpp:4:10:4:10 | 0 | isFromTemplateInstantiation(fn) |
19+
| CPP-205.cpp:4:10:4:10 | 0 | isFromUninstantiatedTemplate(fn) |
2320
| CPP-205.cpp:7:5:7:8 | definition of main | function declaration entry for int main() |
2421
| CPP-205.cpp:7:5:7:8 | main | function int main() |
25-
| CPP-205.cpp:7:12:9:1 | { ... } | |
26-
| CPP-205.cpp:8:3:8:15 | return ... | |
27-
| CPP-205.cpp:8:10:8:11 | call to fn | |
28-
| CPP-205.cpp:8:13:8:13 | 0 | |
29-
| file://:0:0:0:0 | (unnamed parameter 0) | parameter for __va_list_tag& __va_list_tag::operator=(__va_list_tag const&) |
30-
| file://:0:0:0:0 | (unnamed parameter 0) | parameter for __va_list_tag& __va_list_tag::operator=(__va_list_tag&&) |
31-
| file://:0:0:0:0 | __super | |
32-
| file://:0:0:0:0 | __va_list_tag | |
33-
| file://:0:0:0:0 | operator= | function __va_list_tag& __va_list_tag::operator=(__va_list_tag const&) |
34-
| file://:0:0:0:0 | operator= | function __va_list_tag& __va_list_tag::operator=(__va_list_tag&&) |
35-
| file://:0:0:0:0 | y | |

cpp/ql/test/library-tests/CPP-205/elements.ql

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,20 @@ string describe(Element e) {
1414
result =
1515
"parameter declaration entry for " +
1616
getIdentityString(e.(ParameterDeclarationEntry).getFunctionDeclarationEntry().getFunction())
17+
or
18+
exists(Element template |
19+
e.isFromTemplateInstantiation(template) and
20+
result = "isFromTemplateInstantiation(" + template.toString() + ")"
21+
)
22+
or
23+
exists(Element template |
24+
e.isFromUninstantiatedTemplate(template) and
25+
result = "isFromUninstantiatedTemplate(" + template.toString() + ")"
26+
)
1727
}
1828

1929
from Element e
2030
where
21-
not e.getLocation() instanceof UnknownLocation and
31+
e.getLocation().getFile().getBaseName() != "" and
2232
not e instanceof Folder
23-
select e, concat(describe(e), ", ")
33+
select e, strictconcat(describe(e), ", ")
Lines changed: 0 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
1-
| captures.cpp:0:0:0:0 | captures.cpp |
2-
| captures.cpp:1:8:1:8 | declaration of operator= |
3-
| captures.cpp:1:8:1:8 | declaration of operator= |
4-
| captures.cpp:1:8:1:8 | operator= |
5-
| captures.cpp:1:8:1:8 | operator= |
6-
| captures.cpp:1:8:1:10 | definition of foo |
7-
| captures.cpp:1:8:1:10 | foo |
8-
| captures.cpp:2:8:2:8 | a |
9-
| captures.cpp:2:8:2:8 | definition of a |
10-
| captures.cpp:2:14:2:14 | definition of x |
11-
| captures.cpp:2:14:2:14 | x |
12-
| captures.cpp:2:17:6:3 | { ... } |
131
| captures.cpp:3:5:3:5 | (unnamed constructor) |
142
| captures.cpp:3:5:3:5 | (unnamed constructor) |
153
| captures.cpp:3:5:3:5 | (unnamed constructor) |
16-
| captures.cpp:3:5:3:5 | declaration of (unnamed constructor) |
17-
| captures.cpp:3:5:3:5 | declaration of (unnamed constructor) |
18-
| captures.cpp:3:5:3:5 | definition of (unnamed constructor) |
19-
| captures.cpp:3:5:3:5 | definition of operator= |
204
| captures.cpp:3:5:3:5 | operator= |
215
| captures.cpp:3:5:5:5 | [...](...){...} |
226
| captures.cpp:3:5:5:5 | {...} |
23-
| captures.cpp:3:5:5:6 | ExprStmt |
247
| captures.cpp:3:6:3:6 | definition of x |
258
| captures.cpp:3:6:3:6 | x |
269
| captures.cpp:3:6:3:6 | x |
@@ -29,7 +12,6 @@
2912
| captures.cpp:3:9:3:9 | definition of (captured this) |
3013
| captures.cpp:3:9:3:12 | (captured this) |
3114
| captures.cpp:3:9:3:12 | this |
32-
| captures.cpp:3:15:3:15 | definition of operator() |
3315
| captures.cpp:3:15:3:15 | operator() |
3416
| captures.cpp:3:15:5:5 | { ... } |
3517
| captures.cpp:4:7:4:7 | (captured this) |
@@ -41,26 +23,14 @@
4123
| captures.cpp:4:9:4:13 | x |
4224
| captures.cpp:4:13:4:13 | 1 |
4325
| captures.cpp:5:5:5:5 | return ... |
44-
| captures.cpp:6:3:6:3 | return ... |
45-
| captures.cpp:8:8:8:8 | b |
46-
| captures.cpp:8:8:8:8 | definition of b |
47-
| captures.cpp:8:14:8:14 | definition of x |
48-
| captures.cpp:8:14:8:14 | x |
49-
| captures.cpp:8:17:12:3 | { ... } |
5026
| captures.cpp:9:5:9:5 | (unnamed constructor) |
5127
| captures.cpp:9:5:9:5 | (unnamed constructor) |
5228
| captures.cpp:9:5:9:5 | (unnamed constructor) |
53-
| captures.cpp:9:5:9:5 | declaration of (unnamed constructor) |
54-
| captures.cpp:9:5:9:5 | declaration of (unnamed constructor) |
55-
| captures.cpp:9:5:9:5 | definition of (unnamed constructor) |
56-
| captures.cpp:9:5:9:5 | definition of operator= |
5729
| captures.cpp:9:5:9:5 | operator= |
5830
| captures.cpp:9:5:11:5 | [...](...){...} |
5931
| captures.cpp:9:5:11:5 | this |
6032
| captures.cpp:9:5:11:5 | x |
6133
| captures.cpp:9:5:11:5 | {...} |
62-
| captures.cpp:9:5:11:6 | ExprStmt |
63-
| captures.cpp:9:9:9:9 | definition of operator() |
6434
| captures.cpp:9:9:9:9 | operator() |
6535
| captures.cpp:9:9:11:5 | { ... } |
6636
| captures.cpp:10:7:10:7 | (captured this) |
@@ -78,48 +48,23 @@
7848
| captures.cpp:10:9:10:13 | x |
7949
| captures.cpp:10:13:10:13 | 1 |
8050
| captures.cpp:11:5:11:5 | return ... |
81-
| captures.cpp:12:3:12:3 | return ... |
82-
| captures.cpp:14:15:14:15 | c |
83-
| captures.cpp:14:15:14:15 | definition of c |
84-
| captures.cpp:14:21:14:21 | definition of x |
85-
| captures.cpp:14:21:14:21 | x |
86-
| captures.cpp:14:24:18:3 | { ... } |
8751
| captures.cpp:15:5:15:5 | (unnamed constructor) |
8852
| captures.cpp:15:5:15:5 | (unnamed constructor) |
8953
| captures.cpp:15:5:15:5 | (unnamed constructor) |
90-
| captures.cpp:15:5:15:5 | declaration of (unnamed constructor) |
91-
| captures.cpp:15:5:15:5 | declaration of (unnamed constructor) |
92-
| captures.cpp:15:5:15:5 | definition of (unnamed constructor) |
93-
| captures.cpp:15:5:15:5 | definition of operator= |
9454
| captures.cpp:15:5:15:5 | operator= |
9555
| captures.cpp:15:5:17:5 | [...](...){...} |
9656
| captures.cpp:15:5:17:5 | {...} |
97-
| captures.cpp:15:5:17:6 | ExprStmt |
9857
| captures.cpp:15:6:15:6 | definition of x |
9958
| captures.cpp:15:6:15:6 | x |
10059
| captures.cpp:15:6:15:6 | x |
10160
| captures.cpp:15:6:15:6 | x |
102-
| captures.cpp:15:9:15:9 | definition of operator() |
10361
| captures.cpp:15:9:15:9 | operator() |
10462
| captures.cpp:15:9:17:5 | { ... } |
10563
| captures.cpp:16:7:16:7 | call to c |
10664
| captures.cpp:16:7:16:11 | ExprStmt |
10765
| captures.cpp:16:9:16:9 | 0 |
108-
| captures.cpp:16:13:16:49 | // `x` is unused, but still captured. |
10966
| captures.cpp:17:5:17:5 | return ... |
110-
| captures.cpp:18:3:18:3 | return ... |
111-
| captures.cpp:21:5:21:5 | d |
112-
| captures.cpp:21:5:21:5 | definition of d |
113-
| captures.cpp:21:11:21:11 | definition of x |
114-
| captures.cpp:21:11:21:11 | x |
115-
| captures.cpp:21:18:21:18 | definition of y |
116-
| captures.cpp:21:18:21:18 | y |
117-
| captures.cpp:21:21:27:1 | { ... } |
118-
| captures.cpp:22:3:24:4 | declaration |
119-
| captures.cpp:22:8:22:15 | definition of myLambda |
120-
| captures.cpp:22:8:22:15 | myLambda |
12167
| captures.cpp:22:18:24:3 | [...](...){...} |
122-
| captures.cpp:22:18:24:3 | initializer for myLambda |
12368
| captures.cpp:22:18:24:3 | y |
12469
| captures.cpp:22:18:24:3 | {...} |
12570
| captures.cpp:22:19:22:19 | (reference dereference) |
@@ -131,10 +76,6 @@
13176
| captures.cpp:22:19:22:19 | (unnamed parameter 0) |
13277
| captures.cpp:22:19:22:19 | constructor init of field x |
13378
| captures.cpp:22:19:22:19 | constructor init of field y |
134-
| captures.cpp:22:19:22:19 | declaration of (unnamed constructor) |
135-
| captures.cpp:22:19:22:19 | definition of (unnamed constructor) |
136-
| captures.cpp:22:19:22:19 | definition of (unnamed constructor) |
137-
| captures.cpp:22:19:22:19 | definition of operator= |
13879
| captures.cpp:22:19:22:19 | operator= |
13980
| captures.cpp:22:19:22:19 | return ... |
14081
| captures.cpp:22:19:22:19 | x |
@@ -144,9 +85,7 @@
14485
| captures.cpp:22:23:22:23 | x |
14586
| captures.cpp:22:23:22:23 | x |
14687
| captures.cpp:22:23:22:23 | x |
147-
| captures.cpp:22:25:22:25 | definition of operator() |
14888
| captures.cpp:22:25:22:25 | operator() |
149-
| captures.cpp:22:30:22:30 | definition of z |
15089
| captures.cpp:22:30:22:30 | z |
15190
| captures.cpp:22:40:24:3 | { ... } |
15291
| captures.cpp:23:5:23:21 | return ... |
@@ -161,41 +100,14 @@
161100
| captures.cpp:23:16:23:16 | y |
162101
| captures.cpp:23:16:23:16 | y |
163102
| captures.cpp:23:20:23:20 | z |
164-
| captures.cpp:26:3:26:24 | return ... |
165-
| captures.cpp:26:10:26:17 | (const lambda [] type at line 22, col. 19)... |
166-
| captures.cpp:26:10:26:17 | myLambda |
167-
| captures.cpp:26:18:26:18 | call to operator() |
168-
| captures.cpp:26:19:26:22 | 1000 |
169-
| end_pos.cpp:0:0:0:0 | end_pos.cpp |
170-
| end_pos.cpp:2:1:2:14 | #define OPEN { |
171-
| end_pos.cpp:3:6:3:10 | definition of igFun |
172-
| end_pos.cpp:3:6:3:10 | igFun |
173-
| end_pos.cpp:3:14:12:1 | { ... } |
174-
| end_pos.cpp:4:5:4:8 | OPEN |
175-
| end_pos.cpp:4:5:5:5 | { ... } |
176-
| end_pos.cpp:6:5:6:15 | declaration |
177-
| end_pos.cpp:6:9:6:10 | definition of ii |
178-
| end_pos.cpp:6:9:6:10 | ii |
179-
| end_pos.cpp:6:13:6:14 | 0 |
180-
| end_pos.cpp:6:13:6:14 | initializer for ii |
181-
| end_pos.cpp:7:5:7:69 | // EDG used to not give the initialization for this ii capture an |
182-
| end_pos.cpp:8:5:8:20 | // end location: |
183-
| end_pos.cpp:9:5:11:6 | declaration |
184-
| end_pos.cpp:9:10:9:11 | definition of fp |
185-
| end_pos.cpp:9:10:9:11 | fp |
186103
| end_pos.cpp:9:14:11:5 | [...](...){...} |
187-
| end_pos.cpp:9:14:11:5 | initializer for fp |
188104
| end_pos.cpp:9:14:11:5 | {...} |
189105
| end_pos.cpp:9:15:9:15 | (reference dereference) |
190106
| end_pos.cpp:9:15:9:15 | (unnamed constructor) |
191107
| end_pos.cpp:9:15:9:15 | (unnamed constructor) |
192108
| end_pos.cpp:9:15:9:15 | (unnamed constructor) |
193109
| end_pos.cpp:9:15:9:15 | (unnamed parameter 0) |
194110
| end_pos.cpp:9:15:9:15 | constructor init of field ii |
195-
| end_pos.cpp:9:15:9:15 | declaration of (unnamed constructor) |
196-
| end_pos.cpp:9:15:9:15 | definition of (unnamed constructor) |
197-
| end_pos.cpp:9:15:9:15 | definition of (unnamed constructor) |
198-
| end_pos.cpp:9:15:9:15 | definition of operator= |
199111
| end_pos.cpp:9:15:9:15 | ii |
200112
| end_pos.cpp:9:15:9:15 | operator= |
201113
| end_pos.cpp:9:15:9:15 | return ... |
@@ -205,14 +117,10 @@
205117
| end_pos.cpp:9:17:9:18 | (reference to) |
206118
| end_pos.cpp:9:17:9:18 | ii |
207119
| end_pos.cpp:9:17:9:18 | ii |
208-
| end_pos.cpp:9:20:9:20 | definition of operator() |
209120
| end_pos.cpp:9:20:9:20 | operator() |
210121
| end_pos.cpp:9:27:11:5 | { ... } |
211122
| end_pos.cpp:10:9:10:17 | return ... |
212123
| end_pos.cpp:10:16:10:16 | 1 |
213-
| end_pos.cpp:12:1:12:1 | return ... |
214-
| file://:0:0:0:0 | |
215-
| file://:0:0:0:0 | (global namespace) |
216124
| file://:0:0:0:0 | (reference to) |
217125
| file://:0:0:0:0 | (unnamed parameter 0) |
218126
| file://:0:0:0:0 | (unnamed parameter 0) |
@@ -229,90 +137,8 @@
229137
| file://:0:0:0:0 | (unnamed parameter 0) |
230138
| file://:0:0:0:0 | (unnamed parameter 0) |
231139
| file://:0:0:0:0 | (unnamed parameter 0) |
232-
| file://:0:0:0:0 | (unnamed parameter 0) |
233-
| file://:0:0:0:0 | (unnamed parameter 0) |
234-
| file://:0:0:0:0 | (unnamed parameter 0) |
235-
| file://:0:0:0:0 | (unnamed parameter 0) |
236-
| file://:0:0:0:0 | ..()(..) |
237-
| file://:0:0:0:0 | ..()(..) |
238-
| file://:0:0:0:0 | ..(*)(..) |
239-
| file://:0:0:0:0 | ..(*)(..) |
240-
| file://:0:0:0:0 | ..(*)(..) |
241-
| file://:0:0:0:0 | ..(..) |
242-
| file://:0:0:0:0 | __super |
243-
| file://:0:0:0:0 | __va_list_tag |
244-
| file://:0:0:0:0 | __va_list_tag & |
245-
| file://:0:0:0:0 | __va_list_tag && |
246-
| file://:0:0:0:0 | auto |
247-
| file://:0:0:0:0 | const __va_list_tag |
248-
| file://:0:0:0:0 | const __va_list_tag & |
249-
| file://:0:0:0:0 | const foo |
250-
| file://:0:0:0:0 | const foo & |
251-
| file://:0:0:0:0 | const lambda [] type at line 3, col. 5 |
252-
| file://:0:0:0:0 | const lambda [] type at line 3, col. 5 & |
253-
| file://:0:0:0:0 | const lambda [] type at line 3, col. 5 * |
254-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 5 |
255-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 5 & |
256-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 5 * |
257-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 15 |
258-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 15 & |
259-
| file://:0:0:0:0 | const lambda [] type at line 9, col. 15 * |
260-
| file://:0:0:0:0 | const lambda [] type at line 15, col. 5 |
261-
| file://:0:0:0:0 | const lambda [] type at line 15, col. 5 & |
262-
| file://:0:0:0:0 | const lambda [] type at line 15, col. 5 * |
263-
| file://:0:0:0:0 | const lambda [] type at line 22, col. 19 |
264-
| file://:0:0:0:0 | const lambda [] type at line 22, col. 19 & |
265-
| file://:0:0:0:0 | const lambda [] type at line 22, col. 19 * |
266-
| file://:0:0:0:0 | declaration of 1st parameter |
267-
| file://:0:0:0:0 | declaration of 1st parameter |
268-
| file://:0:0:0:0 | declaration of 1st parameter |
269-
| file://:0:0:0:0 | declaration of 1st parameter |
270-
| file://:0:0:0:0 | declaration of 1st parameter |
271-
| file://:0:0:0:0 | declaration of 1st parameter |
272-
| file://:0:0:0:0 | declaration of 1st parameter |
273-
| file://:0:0:0:0 | declaration of 1st parameter |
274-
| file://:0:0:0:0 | declaration of 1st parameter |
275-
| file://:0:0:0:0 | declaration of 1st parameter |
276-
| file://:0:0:0:0 | declaration of 1st parameter |
277-
| file://:0:0:0:0 | declaration of 1st parameter |
278-
| file://:0:0:0:0 | declaration of 1st parameter |
279-
| file://:0:0:0:0 | declaration of 1st parameter |
280-
| file://:0:0:0:0 | declaration of 1st parameter |
281-
| file://:0:0:0:0 | declaration of 1st parameter |
282-
| file://:0:0:0:0 | declaration of 1st parameter |
283140
| file://:0:0:0:0 | decltype([...](...){...}) |
284141
| file://:0:0:0:0 | decltype([...](...){...}) |
285142
| file://:0:0:0:0 | decltype([...](...){...}) |
286143
| file://:0:0:0:0 | decltype([...](...){...}) |
287144
| file://:0:0:0:0 | decltype([...](...){...}) |
288-
| file://:0:0:0:0 | definition of fp_offset |
289-
| file://:0:0:0:0 | definition of gp_offset |
290-
| file://:0:0:0:0 | definition of overflow_arg_area |
291-
| file://:0:0:0:0 | definition of reg_save_area |
292-
| file://:0:0:0:0 | foo & |
293-
| file://:0:0:0:0 | foo && |
294-
| file://:0:0:0:0 | foo * |
295-
| file://:0:0:0:0 | foo *const |
296-
| file://:0:0:0:0 | fp_offset |
297-
| file://:0:0:0:0 | gp_offset |
298-
| file://:0:0:0:0 | int & |
299-
| file://:0:0:0:0 | lambda [] type at line 3, col. 5 & |
300-
| file://:0:0:0:0 | lambda [] type at line 3, col. 5 && |
301-
| file://:0:0:0:0 | lambda [] type at line 3, col. 5 * |
302-
| file://:0:0:0:0 | lambda [] type at line 9, col. 5 & |
303-
| file://:0:0:0:0 | lambda [] type at line 9, col. 5 && |
304-
| file://:0:0:0:0 | lambda [] type at line 9, col. 5 * |
305-
| file://:0:0:0:0 | lambda [] type at line 9, col. 15 & |
306-
| file://:0:0:0:0 | lambda [] type at line 9, col. 15 && |
307-
| file://:0:0:0:0 | lambda [] type at line 9, col. 15 * |
308-
| file://:0:0:0:0 | lambda [] type at line 15, col. 5 & |
309-
| file://:0:0:0:0 | lambda [] type at line 15, col. 5 && |
310-
| file://:0:0:0:0 | lambda [] type at line 15, col. 5 * |
311-
| file://:0:0:0:0 | lambda [] type at line 22, col. 19 & |
312-
| file://:0:0:0:0 | lambda [] type at line 22, col. 19 && |
313-
| file://:0:0:0:0 | lambda [] type at line 22, col. 19 * |
314-
| file://:0:0:0:0 | operator= |
315-
| file://:0:0:0:0 | operator= |
316-
| file://:0:0:0:0 | overflow_arg_area |
317-
| file://:0:0:0:0 | reg_save_area |
318-
| file://:0:0:0:0 | void * |
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import cpp
22

3+
predicate interesting(Element e) {
4+
e instanceof LambdaCapture or
5+
e instanceof LambdaExpression or
6+
e = any(LambdaExpression le).getLambdaFunction() or
7+
e = any(LambdaExpression le).getInitializer() or
8+
e instanceof Closure
9+
}
10+
311
from Element e
4-
where
5-
not e instanceof BuiltInType and
6-
not e instanceof Specifier and
7-
not e instanceof Folder
12+
where interesting(e.getEnclosingElement*())
813
select e
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| extern.cpp:1:20:1:20 | T |
2+
| extern.cpp:2:5:2:5 | f |
3+
| extern.cpp:2:7:2:7 | (unnamed parameter 0) |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import cpp
2+
3+
from Declaration d
4+
where d.getLocation().getFile().getBaseName() != ""
5+
select d

cpp/ql/test/library-tests/templates/extern/elements.expected

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)