Emit readable diagnostic message on base::Callback compilation error |
|||
Issue descriptionCompilation errors around base::Callback are hard to understand, and hard to find a fix. So, it's nice to have to detect typical error cases and emit readable diagnostic message for them (using a static_assert or a clang plugin). E.g.: - Detect base::OnceCallback on the first parameter of base::Bind. - Detect lvalue base::OnceCallback on the first parameter of base::BindOnce. - Detect bare move-only types on base::Bind or base::BindOnce.
,
Jul 25 2017
,
Jul 31 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ae4202edba0e7fd9a6a18f096c17a586869446ff commit ae4202edba0e7fd9a6a18f096c17a586869446ff Author: tzik <tzik@chromium.org> Date: Mon Jul 31 10:41:54 2017 Add static_assert on mismatches of base::Bind args and the target params This CL adds a static_assert to detect the Bind earlier and to emit an readable error message. Bug: 746955 Change-Id: Id8081be63f789c7896a9a4229fe3978a7fdedc41 Reviewed-on: https://chromium-review.googlesource.com/583976 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: Taiju Tsuiki <tzik@chromium.org> Cr-Commit-Position: refs/heads/master@{#490741} [modify] https://crrev.com/ae4202edba0e7fd9a6a18f096c17a586869446ff/base/bind.h [modify] https://crrev.com/ae4202edba0e7fd9a6a18f096c17a586869446ff/base/bind_internal.h [modify] https://crrev.com/ae4202edba0e7fd9a6a18f096c17a586869446ff/base/bind_unittest.nc
,
Aug 16 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by tzik@chromium.org
, Jul 25 2017