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

Unified Diff: base/memory/scoped_ptr_unittest.nc

Issue 1556683003: Fix no-compile base_unittests for base::Pass() -> std::move conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« base/callback_list_unittest.nc ('K') | « base/callback_list_unittest.nc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/scoped_ptr_unittest.nc
diff --git a/base/memory/scoped_ptr_unittest.nc b/base/memory/scoped_ptr_unittest.nc
index ebbfdb69a8dd091c615218cb0f98d189f1a9b724..c176dbe55499635fecf6bcd200b8645f6510e528 100644
--- a/base/memory/scoped_ptr_unittest.nc
+++ b/base/memory/scoped_ptr_unittest.nc
@@ -25,7 +25,7 @@ class RefCountedClass : public base::RefCountedThreadSafe<RefCountedClass> {
#if defined(NCTEST_NO_PASS_DOWNCAST) // [r"fatal error: no viable conversion from returned value of type 'scoped_ptr<\(anonymous namespace\)::Parent, default_delete<\(anonymous namespace\)::Parent>>' to function return type 'scoped_ptr<\(anonymous namespace\)::Child, default_delete<\(anonymous namespace\)::Child>>'"]
scoped_ptr<Child> DowncastUsingPassAs(scoped_ptr<Parent> object) {
- return object.Pass();
+ return std::move(object);
dcheng 2015/12/31 10:24:53 #include <utility>
tzik 2015/12/31 11:10:46 Done.
}
#elif defined(NCTEST_NO_REF_COUNTED_SCOPED_PTR) // [r"fatal error: static_assert failed \"T is a refcounted type and needs a scoped_refptr\""]
@@ -46,7 +46,7 @@ void WontCompile() {
void WontCompile() {
scoped_ptr<int[]> a;
scoped_ptr<int*> b;
- b = a.Pass();
+ b = std::move(a);
}
#elif defined(NCTEST_NO_PASS_TO_ARRAY) // [r"fatal error: no viable overloaded '='"]
@@ -54,21 +54,21 @@ void WontCompile() {
void WontCompile() {
scoped_ptr<int*> a;
scoped_ptr<int[]> b;
- b = a.Pass();
+ b = std::move(a);
}
#elif defined(NCTEST_NO_CONSTRUCT_FROM_ARRAY) // [r"fatal error: no matching constructor for initialization of 'scoped_ptr<int \*>'"]
void WontCompile() {
scoped_ptr<int[]> a;
- scoped_ptr<int*> b(a.Pass());
+ scoped_ptr<int*> b(std::move(a));
}
#elif defined(NCTEST_NO_CONSTRUCT_TO_ARRAY) // [r"fatal error: no matching constructor for initialization of 'scoped_ptr<int \[\]>'"]
void WontCompile() {
scoped_ptr<int*> a;
- scoped_ptr<int[]> b(a.Pass());
+ scoped_ptr<int[]> b(std::move(a));
}
#elif defined(NCTEST_NO_CONSTRUCT_SCOPED_PTR_ARRAY_FROM_NULL) // [r"is ambiguous"]
« base/callback_list_unittest.nc ('K') | « base/callback_list_unittest.nc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698