Index: base/bind_unittest.nc |
diff --git a/base/bind_unittest.nc b/base/bind_unittest.nc |
index 46468eca3b99f32bf26422961cd04c0d380f22bb..24a345d260ff3f9f30aae7db0776c589f6a4b792 100644 |
--- a/base/bind_unittest.nc |
+++ b/base/bind_unittest.nc |
@@ -224,13 +224,27 @@ void WontCompile() { |
Closure cb2 = Bind(cb); |
} |
-#elif defined(NCTEST_DISALLOW_ONCECALLBACK_RUN_ON_LVALUE) // [r"static_assert failed \"OnceCallback::Run\(\) may only be invoked on an rvalue, i\.e\. std::move\(callback\)\.Run\(\)\.\""] |
+#elif defined(NCTEST_DISALLOW_ONCECALLBACK_RUN_ON_LVALUE) // [r"static_assert failed \"OnceCallback::Run\(\) may only be invoked on a non-const rvalue, i\.e\. std::move\(callback\)\.Run\(\)\.\""] |
void WontCompile() { |
OnceClosure cb = Bind([] {}); |
cb.Run(); |
} |
+#elif defined(NCTEST_DISALLOW_ONCECALLBACK_RUN_ON_CONST_LVALUE) // [r"static_assert failed \"OnceCallback::Run\(\) may only be invoked on a non-const rvalue, i\.e\. std::move\(callback\)\.Run\(\)\.\""] |
+ |
+void WontCompile() { |
+ const OnceClosure cb = Bind([] {}); |
+ cb.Run(); |
+} |
+ |
+#elif defined(NCTEST_DISALLOW_ONCECALLBACK_RUN_ON_CONST_RVALUE) // [r"static_assert failed \"OnceCallback::Run\(\) may only be invoked on a non-const rvalue, i\.e\. std::move\(callback\)\.Run\(\)\.\""] |
+ |
+void WontCompile() { |
+ const OnceClosure cb = Bind([] {}); |
+ std::move(cb).Run(); |
+} |
+ |
#endif |
} // namespace base |