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 841d03c7eda9fa3f243e2d971b2a9feab7fe052d..30a332edcd469e565089f06922300fc5a3e64423 100644 |
| --- a/base/memory/scoped_ptr_unittest.nc |
| +++ b/base/memory/scoped_ptr_unittest.nc |
| @@ -4,6 +4,7 @@ |
| #include "base/basictypes.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/memory/ref_counted.h" |
| namespace { |
| @@ -13,6 +14,9 @@ class Parent { |
| class Child : public Parent { |
| }; |
| +class RefCountedClass : public base::RefCountedThreadSafe<RefCountedClass> { |
| +}; |
| + |
| } // namespace |
| #if defined(NCTEST_NO_PASSAS_DOWNCAST) // [r"invalid conversion from"] |
| @@ -21,4 +25,11 @@ scoped_ptr<Child> DowncastUsingPassAs(scoped_ptr<Parent> object) { |
| return object.PassAs<Child>(); |
| } |
| +#elif defined(NCTEST_NO_REF_COUNTED_SCOPED_PTR) // [r"creating array with negative size"] |
|
brettw
2012/04/04 21:31:06
Is it possible to wrap this somehow to 80 cols? I
Sergey Ulanov
2012/04/04 22:28:38
Don't think it is possible right now - all other n
|
| + |
| +// scoped_ptr<> should not work for ref-counted objects. |
| +void WontCompile() { |
| + scoped_ptr<RefCountedClass> x; |
| +} |
| + |
| #endif |