Chromium Code Reviews| Index: base/bind_unittest.nc |
| diff --git a/base/bind_unittest.nc b/base/bind_unittest.nc |
| index e60de076b58c9686a679f02c6a43e0a67d87eaf6..0f86d22688283948b069277723f0c35bb209e521 100644 |
| --- a/base/bind_unittest.nc |
| +++ b/base/bind_unittest.nc |
| @@ -208,6 +208,20 @@ void WontCompile() { |
| Bind([i]() {}); |
| } |
| +#elif defined(NCTEST_DISALLOW_BINDING_ONCE_CALLBACK_WITH_NO_ARGS) // [r"static_assert failed \"Attempting to bind a base::Callback with no additional arguments: save a heap allocation and use the original base::Callback\""] |
| + |
| +void WontCompile() { |
| + internal::OnceClosure cb = internal::BindOnce([] {}); |
| + internal::OnceClosure cb2 = internal::BindOnce(cb); |
|
dcheng
2016/09/24 00:49:17
This technically fails for two reasons: cb is not
dcheng
2016/09/24 00:52:55
Actually, I had a typo the first time. Updated thi
|
| +} |
| + |
| +#elif defined(NCTEST_DISALLOW_BINDING_REPEATING_CALLBACK_WITH_NO_ARGS) // [r"static_assert failed \"Attempting to bind a base::Callback with no additional arguments: save a heap allocation and use the original base::Callback\""] |
| + |
| +void WontCompile() { |
| + Closure cb = Bind([] {}); |
| + Closure cb2 = Bind(cb); |
| +} |
| + |
| #endif |
| } // namespace base |