mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
C++: Annotate tellDifferent with template status
This is helpful for turning real-world cases into test cases.
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | call to C | staticlocals.cpp:30:1:30:1 | return ... | Standard edge, only from QL |
|
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | call to C | staticlocals.cpp:30:1:30:1 | return ... | Standard edge, only from QL | |
|
||||||
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | initializer for c | file://:0:0:0:0 | call to C | Standard edge, only from QL |
|
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | initializer for c | file://:0:0:0:0 | call to C | Standard edge, only from QL | |
|
||||||
| staticlocals__staticlocals_f2 | staticlocals.cpp:29:5:29:17 | declaration | file://:0:0:0:0 | initializer for c | Standard edge, only from QL |
|
| staticlocals__staticlocals_f2 | staticlocals.cpp:29:5:29:17 | declaration | file://:0:0:0:0 | initializer for c | Standard edge, only from QL | |
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
import Compare
|
import Compare
|
||||||
|
|
||||||
|
string describeTemplate(ControlFlowNode node) {
|
||||||
|
node.isFromTemplateInstantiation(_) and
|
||||||
|
result = "instantiation"
|
||||||
|
or
|
||||||
|
node.isFromUninstantiatedTemplate(_) and
|
||||||
|
result = "uninstantiated"
|
||||||
|
}
|
||||||
|
|
||||||
from ControlFlowNode n1, ControlFlowNode n2, string msg
|
from ControlFlowNode n1, ControlFlowNode n2, string msg
|
||||||
where differentEdge(n1, n2, msg)
|
where differentEdge(n1, n2, msg)
|
||||||
select getScopeName(n1), n1, n2, msg
|
select getScopeName(n1), n1, n2, msg, concat(describeTemplate(n1), ", ")
|
||||||
|
|||||||
Reference in New Issue
Block a user