We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1d2731 commit 9f49a22Copy full SHA for 9f49a22
llvm/unittests/ADT/DenseMapTest.cpp
@@ -668,9 +668,14 @@ TEST(DenseMapCustomTest, LookupOr) {
668
669
EXPECT_EQ(M.lookup_or(0, 4u), 3u);
670
EXPECT_EQ(M.lookup_or(1, 4u), 0u);
671
+ EXPECT_EQ(M.lookup_or(2, 4u), 4u);
672
+}
673
- NonDefaultConstructible DefaultV = M.lookup_or(2, 4u);
- EXPECT_EQ(DefaultV, 4u);
674
+TEST(DenseMapCustomTest, LookupOrConstness) {
675
+ DenseMap<int, unsigned *> M;
676
+ unsigned Default = 3u;
677
+ unsigned *Ret = M.lookup_or(0, &Default);
678
+ EXPECT_EQ(Ret, &Default);
679
}
680
681
// Key traits that allows lookup with either an unsigned or char* key;
0 commit comments