summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-04-30 18:44:45 +0000
committerEric Fiselier <eric@efcs.ca>2019-04-30 18:44:45 +0000
commit71aa67506b94a299843a6123009d2677ffe329d2 (patch)
tree071754d10774efcd1d71530aeb381764c687de5e /libcxx/test
parentea349f3ef592c053272ff0053c60eca704028e6e (diff)
downloadbcm5719-llvm-71aa67506b94a299843a6123009d2677ffe329d2.tar.gz
bcm5719-llvm-71aa67506b94a299843a6123009d2677ffe329d2.zip
Support overaligned types in `aligned_storage`.
Summary: The current implementation of aligned storage was written before we had `alignas`, so it used a list of builtin types to force the alignment. But this doesn't work overaligned requests. This patch adds a fallback case supporting over-alignment. It only affects case that were previously ill-formed. Reviewers: rsmith, ldionne, dlj, mclow.lists Reviewed By: mclow.lists Subscribers: mclow.lists, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D61301 llvm-svn: 359596
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
index 0b4aac31580..e7615329598 100644
--- a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
@@ -285,6 +285,14 @@ int main(int, char**)
static_assert(std::alignment_of<T1>::value == 8, "");
static_assert(sizeof(T1) == 16, "");
}
+ {
+ const int Align = 65536;
+ typedef typename std::aligned_storage<1, Align>::type T1;
+ static_assert(std::is_trivial<T1>::value, "");
+ static_assert(std::is_standard_layout<T1>::value, "");
+ static_assert(std::alignment_of<T1>::value == Align, "");
+ static_assert(sizeof(T1) == Align, "");
+ }
return 0;
}
OpenPOWER on IntegriCloud