OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 // This is a "No Compile Test" suite. |
| 6 // http://dev.chromium.org/developers/testing/no-compile-tests |
| 7 |
5 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
6 | 9 |
7 namespace base { | 10 namespace base { |
8 | 11 |
9 struct Producer : SupportsWeakPtr<Producer> {}; | 12 struct Producer : SupportsWeakPtr<Producer> {}; |
10 struct DerivedProducer : Producer {}; | 13 struct DerivedProducer : Producer {}; |
11 struct OtherDerivedProducer : Producer {}; | 14 struct OtherDerivedProducer : Producer {}; |
12 struct MultiplyDerivedProducer : Producer, | 15 struct MultiplyDerivedProducer : Producer, |
13 SupportsWeakPtr<MultiplyDerivedProducer> {}; | 16 SupportsWeakPtr<MultiplyDerivedProducer> {}; |
14 struct Unrelated {}; | 17 struct Unrelated {}; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 #elif defined(NCTEST_AMBIGUOUS_ANCESTORS) // [r"fatal error: ambiguous conversi
on from derived class 'base::MultiplyDerivedProducer' to base class 'base::inter
nal::SupportsWeakPtrBase':"] | 132 #elif defined(NCTEST_AMBIGUOUS_ANCESTORS) // [r"fatal error: ambiguous conversi
on from derived class 'base::MultiplyDerivedProducer' to base class 'base::inter
nal::SupportsWeakPtrBase':"] |
130 | 133 |
131 void WontCompile() { | 134 void WontCompile() { |
132 MultiplyDerivedProducer f; | 135 MultiplyDerivedProducer f; |
133 WeakPtr<MultiplyDerivedProducer> ptr = AsWeakPtr(&f); | 136 WeakPtr<MultiplyDerivedProducer> ptr = AsWeakPtr(&f); |
134 } | 137 } |
135 | 138 |
136 #endif | 139 #endif |
137 | 140 |
138 } | 141 } |
OLD | NEW |