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

Unified Diff: base/containers/scoped_ptr_hash_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: fix whitespace 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
« no previous file with comments | « base/containers/scoped_ptr_hash_map.h ('k') | base/containers/scoped_ptr_map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/containers/scoped_ptr_hash_map_unittest.cc
diff --git a/base/containers/scoped_ptr_hash_map_unittest.cc b/base/containers/scoped_ptr_hash_map_unittest.cc
index 88fe41f9a0dfe4aa2cc020d80ac26720f6482c43..38fc91a3840967086d3515d94cc38e0d453613bc 100644
--- a/base/containers/scoped_ptr_hash_map_unittest.cc
+++ b/base/containers/scoped_ptr_hash_map_unittest.cc
@@ -10,6 +10,15 @@
namespace base {
namespace {
+namespace namespace_with_ignore_result {
+
+class Value {};
+
+template <typename T>
+void ignore_result(const T&) {}
+
+} // namespace namespace_with_ignore_result
+
struct DeleteCounter {
public:
DeleteCounter() {}
@@ -81,5 +90,13 @@ TEST(ScopedPtrHashMapTest, CustomDeleter) {
EXPECT_EQ(3, CountingDeleter::count());
}
+// Test that using a value type from a namespace containing an ignore_result
+// function compiles correctly.
+TEST(ScopedPtrHashMapTest, IgnoreResultCompile) {
+ ScopedPtrHashMap<int, scoped_ptr<namespace_with_ignore_result::Value>>
+ scoped_map;
+ scoped_map.add(1, make_scoped_ptr(new namespace_with_ignore_result::Value));
+}
+
} // namespace
} // namespace base
« no previous file with comments | « base/containers/scoped_ptr_hash_map.h ('k') | base/containers/scoped_ptr_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698