OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/callback.h" | 8 #include "base/callback.h" |
6 #include "base/bind.h" | 9 #include "base/bind.h" |
7 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
8 | 11 |
9 namespace base { | 12 namespace base { |
10 | 13 |
11 // Do not put everything inside an anonymous namespace. If you do, many of the | 14 // Do not put everything inside an anonymous namespace. If you do, many of the |
12 // helper function declarations will generate unused definition warnings. | 15 // helper function declarations will generate unused definition warnings. |
13 | 16 |
14 static const int kParentValue = 1; | 17 static const int kParentValue = 1; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 #elif defined(NCTEST_DISALLOW_ASSIGN_DIFFERENT_TYPES) // [r"fatal error: no via
ble conversion from 'Callback<typename internal::BindState<typename internal::Fu
nctorTraits<void \(\*\)\(int\)>::RunnableType, typename internal::FunctorTraits<
void \(\*\)\(int\)>::RunType, internal::TypeList<> >::UnboundRunType>' to 'Callb
ack<void \(\)>'"] | 196 #elif defined(NCTEST_DISALLOW_ASSIGN_DIFFERENT_TYPES) // [r"fatal error: no via
ble conversion from 'Callback<typename internal::BindState<typename internal::Fu
nctorTraits<void \(\*\)\(int\)>::RunnableType, typename internal::FunctorTraits<
void \(\*\)\(int\)>::RunType, internal::TypeList<> >::UnboundRunType>' to 'Callb
ack<void \(\)>'"] |
194 | 197 |
195 // Bind result cannot be assigned to Callbacks with a mismatching type. | 198 // Bind result cannot be assigned to Callbacks with a mismatching type. |
196 void WontCompile() { | 199 void WontCompile() { |
197 Closure callback_mismatches_bind_type = Bind(&VoidPolymorphic1<int>); | 200 Closure callback_mismatches_bind_type = Bind(&VoidPolymorphic1<int>); |
198 } | 201 } |
199 | 202 |
200 #endif | 203 #endif |
201 | 204 |
202 } // namespace base | 205 } // namespace base |
OLD | NEW |