diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2018-11-29 12:32:57 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2018-11-29 12:32:57 +0000 |
commit | 8c9b385288609fa4af9df746464b26130c9034b1 (patch) | |
tree | a9708881adbc46a1ebb865004599bd1243140bb6 /libstdc++-v3/include/std | |
parent | 479db22783ba162939d607c2a5da5332c09064e0 (diff) | |
download | gcc-8c9b385288609fa4af9df746464b26130c9034b1.zip gcc-8c9b385288609fa4af9df746464b26130c9034b1.tar.gz gcc-8c9b385288609fa4af9df746464b26130c9034b1.tar.bz2 |
PR libstdc++/88119 use alignof in std::alignment_of, not __alignof__
Now that __alignof__ and alignof sometimes disagree it matters which one
we use. The standard says that std::alignment_of<T>::value equals
alignof(T), so we need to use that.
Change the only uses of alignment_of to use __alignof__ to avoid a
change in alignment.
PR libstdc++/88119
* include/ext/aligned_buffer.h (__aligned_membuf): Add comment.
(__aligned_buffer): Use __alignof__ instead of std::alignment_of.
* include/std/type_traits (alignment_of): Use alignof instead of
__alignof__.
* testsuite/20_util/alignment_of/value.cc: Fix test to check values
match alignof not __alignof__, as required by the standard.
From-SVN: r266613
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r-- | libstdc++-v3/include/std/type_traits | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 60094f9..727a545 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -1286,7 +1286,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// alignment_of template<typename _Tp> struct alignment_of - : public integral_constant<std::size_t, __alignof__(_Tp)> { }; + : public integral_constant<std::size_t, alignof(_Tp)> { }; /// rank template<typename> |