Skip to content

Commit d9331e9

Browse files
committed
C++: Add a testcase with forwarding without a constructor.
1 parent 8149caa commit d9331e9

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

cpp/ql/test/library-tests/dataflow/external-models/sinks.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,5 @@
5454
| test.cpp:444:21:444:21 | x | test-sink |
5555
| test.cpp:449:21:449:21 | x | test-sink |
5656
| test.cpp:454:21:454:21 | x | test-sink |
57+
| test.cpp:462:15:462:17 | call to get | test-sink |
58+
| test.cpp:467:13:467:20 | * ... | test-sink |

cpp/ql/test/library-tests/dataflow/external-models/sources.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
| test.cpp:412:11:412:19 | call to ymlSource | local |
2727
| test.cpp:426:11:426:19 | call to ymlSource | local |
2828
| test.cpp:440:11:440:19 | call to ymlSource | local |
29+
| test.cpp:461:15:461:23 | call to ymlSource | local |
2930
| windows.cpp:22:15:22:29 | call to GetCommandLineA | local |
3031
| windows.cpp:34:17:34:38 | call to GetEnvironmentStringsA | local |
3132
| windows.cpp:39:36:39:38 | GetEnvironmentVariableA output argument | local |

cpp/ql/test/library-tests/dataflow/external-models/test.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,4 +453,17 @@ void forward_test_constructor_arity() {
453453
c.emplace(0, 0, x);
454454
ymlSink(c.get().x); // $ ir
455455
}
456+
}
457+
458+
void forward_test_without_constructor() {
459+
{
460+
Forwarder<int> f;
461+
f.forward(ymlSource());
462+
ymlSink(f.get()); // $ MISSING: ir
463+
}
464+
{
465+
Forwarder<int*> f;
466+
f.forward(ymlSourcePtr());
467+
ymlSink(*f.get()); // $ MISSING: ir
468+
}
456469
}

0 commit comments

Comments
 (0)