Chromium Code Reviews| 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"] |