Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: base/containers/scoped_ptr_map_unittest.cc

Issue 1423663010: Change ScopedPtr(Hash)Map to make qualified calls to ignore_result(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/containers/scoped_ptr_map_unittest.cc
diff --git a/base/containers/scoped_ptr_map_unittest.cc b/base/containers/scoped_ptr_map_unittest.cc
index 706b2edfb188b264073989b1d06ce5d79a291dd5..ed48d7920207296cf23940019d8f994057cccdeb 100644
--- a/base/containers/scoped_ptr_map_unittest.cc
+++ b/base/containers/scoped_ptr_map_unittest.cc
@@ -15,6 +15,13 @@
namespace base {
namespace {
+namespace namespace_with_ignore_result {
danakj 2015/10/29 17:48:39 ditto
Sam McNally 2015/10/30 00:18:40 Done.
+
+class Value {};
+
+template <typename T>
+void ignore_result(const T&) {}
+}
// A ScopedDestroyer sets a Boolean to true upon destruction.
class ScopedDestroyer {
@@ -251,5 +258,13 @@ TEST(ScopedPtrMapTest, Passed) {
EXPECT_TRUE(destroyed);
};
+// Test that using a value type from a namespace containing an ignore_result
+// function compiles correctly.
+TEST(ScopedPtrMapTest, IgnoreResultCompile) {
+ ScopedPtrMap<int, scoped_ptr<namespace_with_ignore_result::Value>> scoped_map;
+ scoped_map.insert(1,
+ make_scoped_ptr(new namespace_with_ignore_result::Value));
+}
+
} // namespace
} // namespace base
« base/containers/scoped_ptr_hash_map_unittest.cc ('K') | « base/containers/scoped_ptr_map.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698