mirror of
https://github.com/boostorg/move.git
synced 2025-08-01 05:14:27 +02:00
Add member "data" char array to aligned_storage::type so that placement new does not break strict alignment
This commit is contained in:
@@ -973,7 +973,7 @@ struct aligned_struct;
|
|||||||
template<std::size_t Len>\
|
template<std::size_t Len>\
|
||||||
struct BOOST_ALIGNMENT(A) aligned_struct<Len, A>\
|
struct BOOST_ALIGNMENT(A) aligned_struct<Len, A>\
|
||||||
{\
|
{\
|
||||||
char dummy[Len];\
|
char data[Len];\
|
||||||
};\
|
};\
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -997,9 +997,10 @@ BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x1000)
|
|||||||
// Workaround for bogus [-Wignored-attributes] warning on GCC 6.x/7.x: don't use a type that "directly" carries the alignment attribute.
|
// Workaround for bogus [-Wignored-attributes] warning on GCC 6.x/7.x: don't use a type that "directly" carries the alignment attribute.
|
||||||
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82270
|
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82270
|
||||||
template<std::size_t Len, std::size_t Align>
|
template<std::size_t Len, std::size_t Align>
|
||||||
struct aligned_struct_wrapper
|
union aligned_struct_wrapper
|
||||||
{
|
{
|
||||||
aligned_struct<Len, Align> dummy;
|
aligned_struct<Len, Align> aligner;
|
||||||
|
char data[sizeof(aligned_struct<Len, Align>)];
|
||||||
};
|
};
|
||||||
|
|
||||||
template<std::size_t Len, std::size_t Align>
|
template<std::size_t Len, std::size_t Align>
|
||||||
@@ -1014,7 +1015,7 @@ template<class T, std::size_t Len>
|
|||||||
union aligned_union
|
union aligned_union
|
||||||
{
|
{
|
||||||
T aligner;
|
T aligner;
|
||||||
char dummy[Len];
|
char data[Len];
|
||||||
};
|
};
|
||||||
|
|
||||||
template<std::size_t Len, std::size_t Align, class T, bool Ok>
|
template<std::size_t Len, std::size_t Align, class T, bool Ok>
|
||||||
|
Reference in New Issue
Block a user