aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/OptionalTest.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2020-12-02 22:02:48 -0800
committerFangrui Song <i@maskray.me>2020-12-02 22:02:48 -0800
commit1d6ebdfb66b9d63d34f34ec6ac7ec57eff7cd24b (patch)
tree442e8d4661a5a6e7f05bd1048d8aa6d5811808f8 /llvm/unittests/ADT/OptionalTest.cpp
parentbd726d2796b1a5d2c936b5708bfb49a4b7fb89de (diff)
downloadllvm-1d6ebdfb66b9d63d34f34ec6ac7ec57eff7cd24b.zip
llvm-1d6ebdfb66b9d63d34f34ec6ac7ec57eff7cd24b.tar.gz
llvm-1d6ebdfb66b9d63d34f34ec6ac7ec57eff7cd24b.tar.bz2
Switch from llvm::is_trivially_copyable to std::is_trivially_copyable
GCC<5 did not support std::is_trivially_copyable. Now LLVM builds require 5.1 we can migrate to std::is_trivially_copyable. The Optional.h change made MSVC choke (https://buildkite.com/llvm-project/premerge-checks/builds/18587#cd1bb616-ffdc-4581-9795-b42c284196de) so I leave it out for now. Differential Revision: https://reviews.llvm.org/D92514
Diffstat (limited to 'llvm/unittests/ADT/OptionalTest.cpp')
-rw-r--r--llvm/unittests/ADT/OptionalTest.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/unittests/ADT/OptionalTest.cpp b/llvm/unittests/ADT/OptionalTest.cpp
index 249c926..7506453 100644
--- a/llvm/unittests/ADT/OptionalTest.cpp
+++ b/llvm/unittests/ADT/OptionalTest.cpp
@@ -17,10 +17,10 @@
using namespace llvm;
-static_assert(is_trivially_copyable<Optional<int>>::value,
- "trivially copyable");
+static_assert(std::is_trivially_copyable<Optional<int>>::value,
+ "trivially copyable");
-static_assert(is_trivially_copyable<Optional<std::array<int, 3>>>::value,
+static_assert(std::is_trivially_copyable<Optional<std::array<int, 3>>>::value,
"trivially copyable");
void OptionalWorksInConstexpr() {
@@ -66,8 +66,8 @@ unsigned NonDefaultConstructible::Destructions = 0;
unsigned NonDefaultConstructible::CopyAssignments = 0;
static_assert(
- !is_trivially_copyable<Optional<NonDefaultConstructible>>::value,
- "not trivially copyable");
+ !std::is_trivially_copyable<Optional<NonDefaultConstructible>>::value,
+ "not trivially copyable");
// Test fixture
class OptionalTest : public testing::Test {
@@ -227,9 +227,8 @@ struct MultiArgConstructor {
};
unsigned MultiArgConstructor::Destructions = 0;
-static_assert(
- !is_trivially_copyable<Optional<MultiArgConstructor>>::value,
- "not trivially copyable");
+static_assert(!std::is_trivially_copyable<Optional<MultiArgConstructor>>::value,
+ "not trivially copyable");
TEST_F(OptionalTest, Emplace) {
MultiArgConstructor::ResetCounts();
@@ -278,7 +277,7 @@ unsigned MoveOnly::MoveConstructions = 0;
unsigned MoveOnly::Destructions = 0;
unsigned MoveOnly::MoveAssignments = 0;
-static_assert(!is_trivially_copyable<Optional<MoveOnly>>::value,
+static_assert(!std::is_trivially_copyable<Optional<MoveOnly>>::value,
"not trivially copyable");
TEST_F(OptionalTest, MoveOnlyNull) {
@@ -382,7 +381,7 @@ private:
unsigned Immovable::Constructions = 0;
unsigned Immovable::Destructions = 0;
-static_assert(!is_trivially_copyable<Optional<Immovable>>::value,
+static_assert(!std::is_trivially_copyable<Optional<Immovable>>::value,
"not trivially copyable");
TEST_F(OptionalTest, ImmovableEmplace) {