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

Unified Diff: base/bind_unittest.cc

Issue 2581943005: Explicitly delete some Callback constructors to improve errors.
Patch Set: include clang-cl but exclude msvc Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/callback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_unittest.cc
diff --git a/base/bind_unittest.cc b/base/bind_unittest.cc
index c6b53d55f031e557e3bf7886a7512a09d816a43d..5892c7485dbbfda2ca03c999fd6996f956473a18 100644
--- a/base/bind_unittest.cc
+++ b/base/bind_unittest.cc
@@ -1316,6 +1316,9 @@ TEST_F(BindTest, OnceCallback) {
"RepeatingClosure should be move-assignable");
// Conversions from OnceCallback to RepeatingCallback.
+#if !defined(COMPILER_MSVC) || defined(__clang__)
+ // In theory, this should have been fixed in VS2015 update 2:
+ // https://connect.microsoft.com/VisualStudio/feedback/details/819202
static_assert(!std::is_constructible<
RepeatingClosure, const OnceClosure&>::value,
"OnceClosure should not be convertible to RepeatingClosure.");
@@ -1330,6 +1333,7 @@ TEST_F(BindTest, OnceCallback) {
static_assert(!is_assignable<
RepeatingClosure, OnceClosure&&>::value,
"OnceClosure should not be convertible to RepeatingClosure.");
+#endif
// Copy constructor and assignment of OnceCallback.
static_assert(!std::is_constructible<
« no previous file with comments | « no previous file | base/callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698