Chromium Code Reviews| Index: base/memory/weak_ptr_unittest.nc |
| diff --git a/base/memory/weak_ptr_unittest.nc b/base/memory/weak_ptr_unittest.nc |
| index 9b1226b7941da4117732b211dffe490e9caf9017..d86b0efe5156023129121a438052aaf31e8b6296 100644 |
| --- a/base/memory/weak_ptr_unittest.nc |
| +++ b/base/memory/weak_ptr_unittest.nc |
| @@ -17,7 +17,7 @@ struct MultiplyDerivedProducer : Producer, |
| struct Unrelated {}; |
| struct DerivedUnrelated : Unrelated {}; |
| -#if defined(NCTEST_AUTO_DOWNCAST) // [r"fatal error: cannot initialize a member subobject of type 'base::DerivedProducer \*' with an lvalue of type 'base::Producer \*const'"] |
| +#if defined(NCTEST_AUTO_DOWNCAST) // [r'fatal error: static_assert failed "other must be a subclass of T"'] |
|
Nico
2017/06/28 14:36:56
The changes in this CL also feel like they could b
hans
2017/06/28 20:37:35
Yeah, this is part of the "move ptr_ into WeakPtrB
|
| void WontCompile() { |
| Producer f; |
| @@ -25,7 +25,7 @@ void WontCompile() { |
| WeakPtr<DerivedProducer> derived_ptr = ptr; |
| } |
| -#elif defined(NCTEST_STATIC_DOWNCAST) // [r"fatal error: cannot initialize a member subobject of type 'base::DerivedProducer \*' with an lvalue of type 'base::Producer \*const'"] |
| +#elif defined(NCTEST_STATIC_DOWNCAST) // [r'fatal error: static_assert failed "other must be a subclass of T"'] |
| void WontCompile() { |
| Producer f; |
| @@ -59,7 +59,7 @@ void WontCompile() { |
| SupportsWeakPtr<Producer>::StaticAsWeakPtr<DerivedProducer>(&f); |
| } |
| -#elif defined(NCTEST_UNSAFE_HELPER_DOWNCAST) // [r"fatal error: cannot initialize a member subobject of type 'base::DerivedProducer \*' with an lvalue of type 'base::Producer \*'"] |
| +#elif defined(NCTEST_UNSAFE_HELPER_DOWNCAST) // [r'fatal error: static_assert failed "other must be a subclass of T"'] |
| void WontCompile() { |
| Producer f; |
| @@ -73,14 +73,14 @@ void WontCompile() { |
| WeakPtr<DerivedProducer> ptr = AsWeakPtr<DerivedProducer>(&f); |
| } |
| -#elif defined(NCTEST_UNSAFE_WRONG_INSANTIATED_HELPER_DOWNCAST) // [r"fatal error: cannot initialize a member subobject of type 'base::DerivedProducer \*' with an lvalue of type 'base::Producer \*'"] |
| +#elif defined(NCTEST_UNSAFE_WRONG_INSANTIATED_HELPER_DOWNCAST) // [r'fatal error: static_assert failed "other must be a subclass of T"'] |
| void WontCompile() { |
| - Producer f; |
| + Producer f; |
| WeakPtr<DerivedProducer> ptr = AsWeakPtr<Producer>(&f); |
| } |
| -#elif defined(NCTEST_UNSAFE_HELPER_CAST) // [r"fatal error: cannot initialize a member subobject of type 'base::OtherDerivedProducer \*' with an lvalue of type 'base::DerivedProducer \*'"] |
| +#elif defined(NCTEST_UNSAFE_HELPER_CAST) // [r'fatal error: static_assert failed "other must be a subclass of T"'] |
| void WontCompile() { |
| DerivedProducer f; |
| @@ -94,14 +94,14 @@ void WontCompile() { |
| WeakPtr<OtherDerivedProducer> ptr = AsWeakPtr<OtherDerivedProducer>(&f); |
| } |
| -#elif defined(NCTEST_UNSAFE_WRONG_INSTANTIATED_HELPER_SIDECAST) // [r"fatal error: cannot initialize a member subobject of type 'base::OtherDerivedProducer \*' with an lvalue of type 'base::DerivedProducer \*'"] |
| +#elif defined(NCTEST_UNSAFE_WRONG_INSTANTIATED_HELPER_SIDECAST) // [r'fatal error: static_assert failed "other must be a subclass of T"'] |
| void WontCompile() { |
| DerivedProducer f; |
| WeakPtr<OtherDerivedProducer> ptr = AsWeakPtr<DerivedProducer>(&f); |
| } |
| -#elif defined(NCTEST_UNRELATED_HELPER) // [r"fatal error: cannot initialize a member subobject of type 'base::Unrelated \*' with an lvalue of type 'base::DerivedProducer \*'"] |
| +#elif defined(NCTEST_UNRELATED_HELPER) // [r'fatal error: static_assert failed "other must be a subclass of T"'] |
| void WontCompile() { |
| DerivedProducer f; |