llvm-project/libcxx/include/experimental
Eric Fiselier d108bf85b0 Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`.
Summary:
Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See  llvm.org/PR39713

This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used.

This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement.

I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. 

Reviewers: ldionne, EricWF

Reviewed By: ldionne, EricWF

Subscribers: jyknight, christof, libcxx-commits

Differential Revision: https://reviews.llvm.org/D54814

llvm-svn: 351289
2019-01-16 01:51:12 +00:00
..
__config Re-apply "[libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to." 2018-07-30 22:27:38 +00:00
__memory Add <experimental/memory_resource> 2016-05-07 01:04:55 +00:00
algorithm Remove std::experimental::sample; use std::sample instead. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-01 16:36:08 +00:00
any Fix PR39749 - Headers containing just #error harm __has_include. 2019-01-06 00:37:31 +00:00
chrono Fix PR39749 - Headers containing just #error harm __has_include. 2019-01-06 00:37:31 +00:00
coroutine Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. 2019-01-16 01:51:12 +00:00
deque Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
filesystem Implement <filesystem> 2018-07-27 03:07:09 +00:00
forward_list Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
functional While implementing P0777 - preventing unnecessary decay, I found some non-public uses of decay that could be replaced by __uncvref. NFC intented 2018-02-12 15:41:25 +00:00
iterator Rename identifiers named `__output` 2017-11-14 11:14:25 +00:00
list Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
map Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
memory_resource Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. 2019-01-16 01:51:12 +00:00
numeric Fix PR39749 - Headers containing just #error harm __has_include. 2019-01-06 00:37:31 +00:00
optional Fix PR39749 - Headers containing just #error harm __has_include. 2019-01-06 00:37:31 +00:00
propagate_const Implement LWG#2518 - Non-member swap for propagate_const should call member swap 2018-03-08 15:01:50 +00:00
ratio Fix PR39749 - Headers containing just #error harm __has_include. 2019-01-06 00:37:31 +00:00
regex Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
set Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
simd Re-apply "[libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to." 2018-07-30 22:27:38 +00:00
string Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
string_view Fix PR39749 - Headers containing just #error harm __has_include. 2019-01-06 00:37:31 +00:00
system_error Fix PR39749 - Headers containing just #error harm __has_include. 2019-01-06 00:37:31 +00:00
tuple Fix PR39749 - Headers containing just #error harm __has_include. 2019-01-06 00:37:31 +00:00
type_traits Remove more of the std::experimental bits that are now in std::. All the _v type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-06 23:13:48 +00:00
unordered_map Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
unordered_set Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
utility [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS 2017-01-04 23:56:00 +00:00
vector Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00