From 37d0a0bc04566e6d12c0a67f10302a898df60277 Mon Sep 17 00:00:00 2001 From: Paul Groke Date: Tue, 3 Oct 2017 12:47:04 +0200 Subject: [PATCH] Workaround for bogus [-Wignored-attributes] warning on GCC 6.x/7.x --- include/boost/move/detail/type_traits.hpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/include/boost/move/detail/type_traits.hpp b/include/boost/move/detail/type_traits.hpp index 1b5d838..272cb11 100644 --- a/include/boost/move/detail/type_traits.hpp +++ b/include/boost/move/detail/type_traits.hpp @@ -967,14 +967,13 @@ typedef union max_align max_align_t; #if !defined(BOOST_NO_ALIGNMENT) template -struct aligned_storage_impl; +struct aligned_struct; #define BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(A)\ template\ -struct BOOST_ALIGNMENT(A) aligned_storage_impl\ +struct BOOST_ALIGNMENT(A) aligned_struct\ {\ char dummy[Len];\ - typedef aligned_storage_impl 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 +struct aligned_struct_wrapper +{ + aligned_struct dummy; +}; + +template +struct aligned_storage_impl +{ + typedef aligned_struct_wrapper type; +}; + #else //BOOST_NO_ALIGNMENT template