Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: base/bind_unittest.nc

Issue 2115533002: Allow binding captureless lambdas into base::Callback by base::Bind (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@05_remove_runnable
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/bind_unittest.cc ('k') | styleguide/c++/c++11.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 weak_ptr_with_non_void_return_type.Run(); 194 weak_ptr_with_non_void_return_type.Run();
195 } 195 }
196 196
197 #elif defined(NCTEST_DISALLOW_ASSIGN_DIFFERENT_TYPES) // [r"fatal error: no via ble conversion from 'Callback<MakeUnboundRunType<void \(\*\)\(int\)>>' to 'Callb ack<void \(\)>'"] 197 #elif defined(NCTEST_DISALLOW_ASSIGN_DIFFERENT_TYPES) // [r"fatal error: no via ble conversion from 'Callback<MakeUnboundRunType<void \(\*\)\(int\)>>' to 'Callb ack<void \(\)>'"]
198 198
199 // Bind result cannot be assigned to Callbacks with a mismatching type. 199 // Bind result cannot be assigned to Callbacks with a mismatching type.
200 void WontCompile() { 200 void WontCompile() {
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>'"]
205
206 void WontCompile() {
207 int i = 0;
208 Bind([i]() {});
209 }
210
204 #endif 211 #endif
205 212
206 } // namespace base 213 } // namespace base
OLDNEW
« no previous file with comments | « base/bind_unittest.cc ('k') | styleguide/c++/c++11.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698