Skip to content

Commit 3d43160

Browse files
committed
C++: Combine the usings tests and add detail about classes.
1 parent 9fc37d1 commit 3d43160

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
| templates.cpp:9:5:9:14 | using declaration |
2-
| usings.cpp:8:1:8:11 | using declaration |
3-
| usings.cpp:9:1:9:17 | using namespace N |
4-
| usings.cpp:18:3:18:13 | using declaration |
5-
| usings.cpp:21:5:21:14 | using declaration |
6-
| usings.cpp:34:3:34:20 | using declaration |
7-
| usings.cpp:42:5:42:22 | using declaration |
1+
| templates.cpp:9:5:9:14 | using declaration | UsingDeclarationEntry, enclosingElement:std |
2+
| usings.cpp:8:1:8:11 | using declaration | UsingDeclarationEntry, enclosingElement:(global namespace) |
3+
| usings.cpp:9:1:9:17 | using namespace N | UsingDirectiveEntry, enclosingElement:(global namespace) |
4+
| usings.cpp:18:3:18:13 | using declaration | UsingDeclarationEntry, enclosingElement:D |
5+
| usings.cpp:21:5:21:14 | using declaration | UsingDeclarationEntry, enclosingElement:{ ... } |
6+
| usings.cpp:34:3:34:20 | using declaration | UsingDeclarationEntry, enclosingElement:TD |
7+
| usings.cpp:42:5:42:22 | using declaration | UsingDeclarationEntry, enclosingElement:nsbar |
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
import cpp
22

3+
string describe(UsingEntry ue) {
4+
ue instanceof UsingDeclarationEntry and
5+
result = "UsingDeclarationEntry"
6+
or
7+
ue instanceof UsingDirectiveEntry and
8+
result = "UsingDirectiveEntry"
9+
or
10+
result = "enclosingElement:" + ue.getEnclosingElement().toString()
11+
}
12+
313
from UsingEntry ue
4-
select ue
14+
select ue, concat(describe(ue), ", ")

cpp/ql/test/library-tests/usings/Usings2.expected

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

cpp/ql/test/library-tests/usings/Usings2.ql

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

0 commit comments

Comments
 (0)