Skip to content

Commit 0f27310

Browse files
committed
C++: Annotate tellDifferent with template status
This is helpful for turning real-world cases into test cases.
1 parent c90fd32 commit 0f27310

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | call to C | staticlocals.cpp:30:1:30:1 | return ... | Standard edge, only from QL |
2-
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | initializer for c | file://:0:0:0:0 | call to C | Standard edge, only from QL |
3-
| staticlocals__staticlocals_f2 | staticlocals.cpp:29:5:29:17 | declaration | file://:0:0:0:0 | initializer for c | Standard edge, only from QL |
1+
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | call to C | staticlocals.cpp:30:1:30:1 | return ... | Standard edge, only from QL | |
2+
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | initializer for c | file://:0:0:0:0 | call to C | Standard edge, only from QL | |
3+
| staticlocals__staticlocals_f2 | staticlocals.cpp:29:5:29:17 | declaration | file://:0:0:0:0 | initializer for c | Standard edge, only from QL | |
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import Compare
22

3+
string describeTemplate(ControlFlowNode node) {
4+
node.isFromTemplateInstantiation(_) and
5+
result = "instantiation"
6+
or
7+
node.isFromUninstantiatedTemplate(_) and
8+
result = "uninstantiated"
9+
}
10+
311
from ControlFlowNode n1, ControlFlowNode n2, string msg
412
where differentEdge(n1, n2, msg)
5-
select getScopeName(n1), n1, n2, msg
13+
select getScopeName(n1), n1, n2, msg, concat(describeTemplate(n1), ", ")

0 commit comments

Comments
 (0)