| 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. | 5 // This is a "No Compile Test" suite. |
| 6 // http://dev.chromium.org/developers/testing/no-compile-tests | 6 // http://dev.chromium.org/developers/testing/no-compile-tests |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 Closure callback_mismatches_bind_type = Bind(&VoidPolymorphic1<int>); | 201 Closure callback_mismatches_bind_type = Bind(&VoidPolymorphic1<int>); |
| 202 } | 202 } |
| 203 | 203 |
| 204 #elif defined(NCTEST_DISALLOW_CAPTURING_LAMBDA) // [r"fatal error: implicit ins
tantiation of undefined template 'base::internal::FunctorTraits<\(lambda at ../.
./base/bind_unittest.nc:[0-9]+:[0-9]+\), void>'"] | 204 #elif defined(NCTEST_DISALLOW_CAPTURING_LAMBDA) // [r"fatal error: implicit ins
tantiation of undefined template 'base::internal::FunctorTraits<\(lambda at ../.
./base/bind_unittest.nc:[0-9]+:[0-9]+\), void>'"] |
| 205 | 205 |
| 206 void WontCompile() { | 206 void WontCompile() { |
| 207 int i = 0; | 207 int i = 0; |
| 208 Bind([i]() {}); | 208 Bind([i]() {}); |
| 209 } | 209 } |
| 210 | 210 |
| 211 #elif defined(NCTEST_DISALLOW_BINDING_CALLBACK_WITH_NO_ARGS) // [r"static_asser
t failed \"Attempting to bind a base::Callback with no additional arguments: sav
e a heap allocation and use the original base::Callback\""] |
| 212 |
| 213 void WontCompile() { |
| 214 Closure cb = Bind([] {}); |
| 215 Closure cb2 = Bind(cb); |
| 216 } |
| 217 |
| 211 #endif | 218 #endif |
| 212 | 219 |
| 213 } // namespace base | 220 } // namespace base |
| OLD | NEW |