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

Unified Diff: third_party/WebKit/Source/wtf/TypeTraitsTest.cpp

Issue 1771303002: WTF: Fix Vector<T> memcpy'ing incorrectly for some T. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final MSVC workaround. Created 4 years, 9 months 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
Index: third_party/WebKit/Source/wtf/TypeTraitsTest.cpp
diff --git a/third_party/WebKit/Source/wtf/TypeTraitsTest.cpp b/third_party/WebKit/Source/wtf/TypeTraitsTest.cpp
index 12fec336318e09017a29f60baf81d8ae0be5e4ea..79fddfcba97cd1be3d60843586d0d982e06de690 100644
--- a/third_party/WebKit/Source/wtf/TypeTraitsTest.cpp
+++ b/third_party/WebKit/Source/wtf/TypeTraitsTest.cpp
@@ -103,6 +103,67 @@ static_assert((IsSubclassOfTemplate<TestDerivedClass, TestBaseClass>::value), "D
typedef int IntArray[];
typedef int IntArraySized[4];
+#if !COMPILER(MSVC) || COMPILER(CLANG)
+
+class AssignmentDeleted final {
+private:
+ AssignmentDeleted& operator=(const AssignmentDeleted&) = delete;
+};
+
+static_assert(!IsCopyAssignable<AssignmentDeleted>::value, "AssignmentDeleted isn't copy assignable.");
+static_assert(!IsMoveAssignable<AssignmentDeleted>::value, "AssignmentDeleted isn't move assignable.");
+
+class AssignmentPrivate final {
+private:
+ AssignmentPrivate& operator=(const AssignmentPrivate&);
+};
+
+static_assert(!IsCopyAssignable<AssignmentPrivate>::value, "AssignmentPrivate isn't copy assignable.");
+static_assert(!IsMoveAssignable<AssignmentPrivate>::value, "AssignmentPrivate isn't move assignable.");
+
+class CopyAssignmentDeleted final {
+public:
+ CopyAssignmentDeleted& operator=(CopyAssignmentDeleted&&);
+private:
+ CopyAssignmentDeleted& operator=(const CopyAssignmentDeleted&) = delete;
+};
+
+static_assert(!IsCopyAssignable<CopyAssignmentDeleted>::value, "CopyAssignmentDeleted isn't copy assignable.");
+static_assert(IsMoveAssignable<CopyAssignmentDeleted>::value, "CopyAssignmentDeleted is move assignable.");
+
+class CopyAssignmentPrivate final {
+public:
+ CopyAssignmentPrivate& operator=(CopyAssignmentPrivate&&);
+private:
+ CopyAssignmentPrivate& operator=(const CopyAssignmentPrivate&);
+};
+
+static_assert(!IsCopyAssignable<CopyAssignmentPrivate>::value, "CopyAssignmentPrivate isn't copy assignable.");
+static_assert(IsMoveAssignable<CopyAssignmentPrivate>::value, "CopyAssignmentPrivate is move assignable.");
+
+class CopyAssignmentUndeclared final {
+public:
+ CopyAssignmentUndeclared& operator=(CopyAssignmentUndeclared&&);
+};
+
+static_assert(!IsCopyAssignable<CopyAssignmentUndeclared>::value, "CopyAssignmentUndeclared isn't copy assignable.");
+static_assert(IsMoveAssignable<CopyAssignmentUndeclared>::value, "CopyAssignmentUndeclared is move assignable.");
+
+class Assignable final {
+public:
+ Assignable& operator=(const Assignable&);
+};
+
+static_assert(IsCopyAssignable<Assignable>::value, "Assignable is copy assignable.");
+static_assert(IsMoveAssignable<Assignable>::value, "Assignable is move assignable.");
+
+class AssignableImplicit final { };
+
+static_assert(IsCopyAssignable<AssignableImplicit>::value, "AssignableImplicit is copy assignable.");
+static_assert(IsMoveAssignable<AssignableImplicit>::value, "AssignableImplicit is move assignable.");
+
+#endif // !COMPILER(MSVC) || COMPILER(CLANG)
+
} // anonymous namespace
} // namespace WTF

Powered by Google App Engine
This is Rietveld 408576698