diff --git a/include/boost/move/detail/type_traits.hpp b/include/boost/move/detail/type_traits.hpp index f2a48db..2d49ace 100644 --- a/include/boost/move/detail/type_traits.hpp +++ b/include/boost/move/detail/type_traits.hpp @@ -1060,8 +1060,9 @@ BOOST_MOVE_ALIGNED_STRUCT(4096); template union aligned_union { - aligned_struct aligner; - unsigned char data[Len]; + typedef aligned_struct aligner_t; + aligner_t aligner; + unsigned char data[Len > sizeof(aligner_t) ? Len : sizeof(aligner_t)]; }; template @@ -1106,7 +1107,7 @@ template union aligned_struct_wrapper { aligned_struct aligner; - unsigned char data[sizeof(aligned_struct)]; + unsigned char data[Len > sizeof(aligner) ? Len : sizeof(aligner)]; }; template @@ -1121,7 +1122,7 @@ template union aligned_union { T aligner; - unsigned char data[Len]; + unsigned char data[Len > sizeof(aligner) ? Len : sizeof(aligner)]; }; template