Improve compile error for OnceCallback |
||
Issue descriptionCurrently, if you have something which forgets to std::move(): OnceClosure closure = base::BindOnce(...); closure.Run(); The compile error looks something like this: ../../base/bind_unittest.cc:415:17: error: cannot initialize object parameter of type 'base::internal::RunMixin<base::Callback<int (int), base::internal::CopyMode::MoveOnly, base::internal::RepeatMode::Once> >' with an expression of type 'OnceCallback<int (int)>' (aka 'base::Callback<int (int), base::internal::CopyMode::MoveOnly, base::internal::RepeatMode::Once>') It would be nice if we could make this more readable: there's an upstream bug with clang that the diagnostic simply isn't helpful (https://llvm.org/bugs/show_bug.cgi?id=31067), but even with that change, I think it's easy to misunderstand this error.
,
Nov 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/77172b96f4e84e91ace073cfacfcd9a50a3d96d8 commit 77172b96f4e84e91ace073cfacfcd9a50a3d96d8 Author: dcheng <dcheng@chromium.org> Date: Tue Nov 22 07:46:06 2016 Improve compile error when invoking OnceCallback::Run on a non-rvalue. Some callback helper templates have also been simplified. BUG= 667031 Review-Url: https://codereview.chromium.org/2517793002 Cr-Commit-Position: refs/heads/master@{#433810} [modify] https://crrev.com/77172b96f4e84e91ace073cfacfcd9a50a3d96d8/base/bind_unittest.nc [modify] https://crrev.com/77172b96f4e84e91ace073cfacfcd9a50a3d96d8/base/callback.h
,
Nov 22 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by dcheng@chromium.org
, Nov 19 2016Status: Started (was: Available)