Index: include/type_traits =================================================================== --- include/type_traits +++ include/type_traits @@ -1768,6 +1768,9 @@ __nat > > > > > > > > > > __all_types; +template +struct _ALIGNAS(_Align) __fallback_overaligned {}; + template struct __find_pod; template @@ -1776,7 +1779,7 @@ typedef typename conditional< _Align == _Hp::value, typename _Hp::type, - void + __fallback_overaligned<_Align> >::type type; }; @@ -1813,7 +1816,6 @@ struct _LIBCPP_TEMPLATE_VIS aligned_storage { typedef typename __find_pod<__all_types, _Align>::type _Aligner; - static_assert(!is_void<_Aligner>::value, ""); union type { _Aligner __align; Index: test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp =================================================================== --- test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp +++ test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp @@ -285,6 +285,14 @@ static_assert(std::alignment_of::value == 8, ""); static_assert(sizeof(T1) == 16, ""); } + { + const int Align = 65536; + typedef typename std::aligned_storage<1, Align>::type T1; + static_assert(std::is_trivial::value, ""); + static_assert(std::is_standard_layout::value, ""); + static_assert(std::alignment_of::value == Align, ""); + static_assert(sizeof(T1) == Align, ""); + } return 0; }