mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
C++: Combine the usings tests and add detail about classes.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
| templates.cpp:9:5:9:14 | using declaration |
|
||||
| usings.cpp:8:1:8:11 | using declaration |
|
||||
| usings.cpp:9:1:9:17 | using namespace N |
|
||||
| usings.cpp:18:3:18:13 | using declaration |
|
||||
| usings.cpp:21:5:21:14 | using declaration |
|
||||
| usings.cpp:34:3:34:20 | using declaration |
|
||||
| usings.cpp:42:5:42:22 | using declaration |
|
||||
| templates.cpp:9:5:9:14 | using declaration | UsingDeclarationEntry, enclosingElement:std |
|
||||
| usings.cpp:8:1:8:11 | using declaration | UsingDeclarationEntry, enclosingElement:(global namespace) |
|
||||
| usings.cpp:9:1:9:17 | using namespace N | UsingDirectiveEntry, enclosingElement:(global namespace) |
|
||||
| usings.cpp:18:3:18:13 | using declaration | UsingDeclarationEntry, enclosingElement:D |
|
||||
| usings.cpp:21:5:21:14 | using declaration | UsingDeclarationEntry, enclosingElement:{ ... } |
|
||||
| usings.cpp:34:3:34:20 | using declaration | UsingDeclarationEntry, enclosingElement:TD |
|
||||
| usings.cpp:42:5:42:22 | using declaration | UsingDeclarationEntry, enclosingElement:nsbar |
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
import cpp
|
||||
|
||||
string describe(UsingEntry ue) {
|
||||
ue instanceof UsingDeclarationEntry and
|
||||
result = "UsingDeclarationEntry"
|
||||
or
|
||||
ue instanceof UsingDirectiveEntry and
|
||||
result = "UsingDirectiveEntry"
|
||||
or
|
||||
result = "enclosingElement:" + ue.getEnclosingElement().toString()
|
||||
}
|
||||
|
||||
from UsingEntry ue
|
||||
select ue
|
||||
select ue, concat(describe(ue), ", ")
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
| templates.cpp:9:5:9:14 | using declaration | file://:0:0:0:0 | std |
|
||||
| usings.cpp:8:1:8:11 | using declaration | file://:0:0:0:0 | (global namespace) |
|
||||
| usings.cpp:9:1:9:17 | using namespace N | file://:0:0:0:0 | (global namespace) |
|
||||
| usings.cpp:18:3:18:13 | using declaration | usings.cpp:16:8:16:8 | D |
|
||||
| usings.cpp:21:5:21:14 | using declaration | usings.cpp:20:13:23:3 | { ... } |
|
||||
| usings.cpp:34:3:34:20 | using declaration | usings.cpp:32:8:32:9 | TD |
|
||||
| usings.cpp:42:5:42:22 | using declaration | usings.cpp:41:11:41:15 | nsbar |
|
||||
@@ -1,5 +0,0 @@
|
||||
import cpp
|
||||
|
||||
from UsingEntry ue, Element e
|
||||
where e = ue.getEnclosingElement()
|
||||
select ue, e
|
||||
Reference in New Issue
Block a user