mirror of
https://github.com/boostorg/move.git
synced 2025-07-31 12:57:14 +02:00
Workaround for bogus [-Wignored-attributes] warning on GCC 6.x/7.x
This commit is contained in:
@ -967,14 +967,13 @@ typedef union max_align max_align_t;
|
||||
#if !defined(BOOST_NO_ALIGNMENT)
|
||||
|
||||
template<std::size_t Len, std::size_t Align>
|
||||
struct aligned_storage_impl;
|
||||
struct aligned_struct;
|
||||
|
||||
#define BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(A)\
|
||||
template<std::size_t Len>\
|
||||
struct BOOST_ALIGNMENT(A) aligned_storage_impl<Len, A>\
|
||||
struct BOOST_ALIGNMENT(A) aligned_struct<Len, A>\
|
||||
{\
|
||||
char dummy[Len];\
|
||||
typedef aligned_storage_impl<Len, A> type;\
|
||||
};\
|
||||
//
|
||||
|
||||
@ -995,6 +994,20 @@ BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x1000)
|
||||
|
||||
#undef BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT
|
||||
|
||||
// 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
|
||||
template<std::size_t Len, std::size_t Align>
|
||||
struct aligned_struct_wrapper
|
||||
{
|
||||
aligned_struct<Len, Align> dummy;
|
||||
};
|
||||
|
||||
template<std::size_t Len, std::size_t Align>
|
||||
struct aligned_storage_impl
|
||||
{
|
||||
typedef aligned_struct_wrapper<Len, Align> type;
|
||||
};
|
||||
|
||||
#else //BOOST_NO_ALIGNMENT
|
||||
|
||||
template<class T, std::size_t Len>
|
||||
|
Reference in New Issue
Block a user