[all-commits] [llvm/llvm-project] 98f778: Avoid using std::max_align_t in pre-C++11 mode

Joerg Sonnenberger via All-commits all-commits at lists.llvm.org
Fri Apr 3 16:38:58 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 98f77828a98fd05760987598db1355cf08b643bd
      https://github.com/llvm/llvm-project/commit/98f77828a98fd05760987598db1355cf08b643bd
  Author: Joerg Sonnenberger <joerg at bec.de>
  Date:   2020-04-04 (Sat, 04 Apr 2020)

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

  Log Message:
  -----------
  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




More information about the All-commits mailing list