summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/OptionalTest.cpp
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@redhat.com>2019-02-16 09:19:58 +0000
committerSerge Guelton <sguelton@redhat.com>2019-02-16 09:19:58 +0000
commit98b4fd82b72f95542ce398c477f7a46df05b2e6a (patch)
tree51696d87bab9f9c265eba71b4a8d80ed48938ceb /llvm/unittests/ADT/OptionalTest.cpp
parenta05d442391de4a75f26036bee3d5d46ac49f69b2 (diff)
downloadbcm5719-llvm-98b4fd82b72f95542ce398c477f7a46df05b2e6a.tar.gz
bcm5719-llvm-98b4fd82b72f95542ce398c477f7a46df05b2e6a.zip
Make Optional<T> Trivially Copyable when T is trivially copyable
This is another attempt in the process, works nicely on my setup, let's check how it behaves on other targets. llvm-svn: 354199
Diffstat (limited to 'llvm/unittests/ADT/OptionalTest.cpp')
-rw-r--r--llvm/unittests/ADT/OptionalTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/OptionalTest.cpp b/llvm/unittests/ADT/OptionalTest.cpp
index 98adaccca96..015fcf38981 100644
--- a/llvm/unittests/ADT/OptionalTest.cpp
+++ b/llvm/unittests/ADT/OptionalTest.cpp
@@ -14,8 +14,15 @@
#include <array>
+
using namespace llvm;
+static_assert(llvm::is_trivially_copyable<Optional<int>>::value,
+ "trivially copyable");
+
+static_assert(llvm::is_trivially_copyable<Optional<std::array<int, 3>>>::value,
+ "trivially copyable");
+
namespace {
struct NonDefaultConstructible {
OpenPOWER on IntegriCloud