[PATCH] D41746: Make std::get_temporary_buffer respect overaligned types when possible
Eric Fiselier via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 11 14:34:57 PST 2018
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.
This LGTM minus nits.
Is there a LWG issue or paper that specifies this change? or is it just a general bug fix?
================
Comment at: include/memory:2007
+#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
+ if (alignof(_Tp) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
+ {
----------------
Please use the `alignment_of` trait; since that's always available within the library, but different spellings of the `alignof` keyword aren't.
================
Comment at: include/memory:2048
+ {
+ std::align_val_t __al = std::align_val_t(alignof(_Tp));
+ ::operator delete(__p, __al);
----------------
`alignment_of`.
Repository:
rCXX libc++
https://reviews.llvm.org/D41746
More information about the cfe-commits
mailing list