Skip to content

Commit 6d62db8

Browse files
authored
Adding getTestKey and getTestValue for std::optional<T>
1 parent ddae4e7 commit 6d62db8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/unittests/ADT/DenseMapTest.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ struct CtorTesterMapInfo {
8787
CtorTester getTestKey(int i, CtorTester *) { return CtorTester(i); }
8888
CtorTester getTestValue(int i, CtorTester *) { return CtorTester(42 + i); }
8989

90+
std::optional<uint32_t> getTestKey(int i, std::optional<uint32_t> *) {
91+
return i;
92+
}
93+
94+
std::optional<uint32_t> getTestValue(int i, std::optional<uint32_t> *) {
95+
return 42 + i;
96+
}
97+
9098
// Test fixture, with helper functions implemented by forwarding to global
9199
// function overloads selected by component types of the type parameter. This
92100
// allows all of the map implementations to be tested with shared

0 commit comments

Comments
 (0)