[PATCH] D50344: [libc++] Enable aligned allocation based on feature test macro, irrespective of standard

Louis Dionne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 9 05:26:55 PDT 2018


ldionne added inline comments.


================
Comment at: libcxx/include/new:111-116
 #if !__has_builtin(__builtin_operator_new) || \
    __has_builtin(__builtin_operator_new) < 201802L || \
    defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) || \
    !defined(__cpp_aligned_new) || __cpp_aligned_new < 201606
 #define _LIBCPP_HAS_NO_BUILTIN_ALIGNED_OPERATOR_NEW_DELETE
 #endif
----------------
vsapsai wrote:
> Maybe move this to `__config` too? This way we'll have `__cpp_aligned_new`-related macros together.
The big difference is that `_LIBCPP_HAS_NO_BUILTIN_ALIGNED_OPERATOR_NEW_DELETE` is only used in `<new>`, whereas `_LIBCPP_HAS_NO_ALIGNED_ALLOCATION` was used in other files as well. Hence, I feel like it makes more sense to lift `_LIBCPP_HAS_NO_ALIGNED_ALLOCATION` into `<__config>`, but not `_LIBCPP_HAS_NO_BUILTIN_ALIGNED_OPERATOR_NEW_DELETE `.


Repository:
  rCXX libc++

https://reviews.llvm.org/D50344





More information about the cfe-commits mailing list