C++: Annotate tellDifferent with template status

This is helpful for turning real-world cases into test cases.
This commit is contained in:
Jonas Jensen
2019-09-18 14:23:52 +02:00
parent c90fd32a78
commit 0f2731064d
2 changed files with 12 additions and 4 deletions

View File

@@ -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 | |

View File

@@ -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), ", ")