Avoid using std::max_align_t in pre-C++11 mode
authorJoerg Sonnenberger <joerg@bec.de>
Fri, 3 Apr 2020 22:48:02 +0000 (00:48 +0200)
committerJoerg Sonnenberger <joerg@bec.de>
Fri, 3 Apr 2020 23:38:41 +0000 (01:38 +0200)
commit98f77828a98fd05760987598db1355cf08b643bd
treebb414340676f3be69376c088161a48941b971f7f
parenta8c8b627f23f204fb621bd2a8c495cfc8bc16ae7
Avoid using std::max_align_t in pre-C++11 mode

Always depend on the compiler to have a correct implementation of
max_align_t in stddef.h and don't provide a fallback. For pre-C++11,
require __STDCPP_NEW_ALIGNMENT__ in <new> as provided by clang in all
standard modes. Adjust test cases to avoid testing or using max_align_t
in pre-C++11 mode and also to better deal with alignof(max_align_t)>16.
Document requirements of the alignment tests around natural alignment of
power-of-two-sized types.

Differential revision: https://reviews.llvm.org/D73245
libcxx/include/cstddef
libcxx/include/stddef.h
libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/db_deallocate.pass.cpp
libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp
libcxx/test/std/depr/depr.c.headers/stddef_h.pass.cpp
libcxx/test/std/language.support/support.types/max_align_t.pass.cpp
libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp