@@ -88,7 +88,6 @@ namespace std {
8888# include < __new/allocate.h>
8989# include < __type_traits/add_cv_quals.h>
9090# include < __type_traits/add_pointer.h>
91- # include < __type_traits/aligned_storage.h>
9291# include < __type_traits/conditional.h>
9392# include < __type_traits/decay.h>
9493# include < __type_traits/enable_if.h>
@@ -147,14 +146,13 @@ template <class _ValueType>
147146_LIBCPP_HIDE_FROM_ABI add_pointer_t <_ValueType> any_cast (any*) _NOEXCEPT;
148147
149148namespace __any_imp {
150- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
151- using _Buffer _LIBCPP_NODEBUG = aligned_storage_t <3 * sizeof (void *), alignof (void *)>;
152- _LIBCPP_SUPPRESS_DEPRECATED_POP
149+ inline constexpr size_t __small_buffer_size = 3 * sizeof (void *);
150+ inline constexpr size_t __small_buffer_alignment = alignof (void *);
153151
154152template <class _Tp >
155153using _IsSmallObject _LIBCPP_NODEBUG =
156154 integral_constant<bool ,
157- sizeof (_Tp) <= sizeof (_Buffer) && alignof (_Buffer) % alignof ( _Tp) == 0 &&
155+ sizeof (_Tp) <= __small_buffer_size && alignof (_Tp) <= __small_buffer_alignment &&
158156 is_nothrow_move_constructible<_Tp>::value >;
159157
160158enum class _Action { _Destroy, _Copy, _Move, _Get, _TypeInfo };
@@ -284,7 +282,7 @@ private:
284282 union _Storage {
285283 _LIBCPP_HIDE_FROM_ABI constexpr _Storage () : __ptr (nullptr ) {}
286284 void * __ptr;
287- __any_imp::_Buffer __buf;
285+ alignas ( __any_imp::__small_buffer_alignment) char __buf[__any_imp::__small_buffer_size] ;
288286 };
289287
290288 _LIBCPP_HIDE_FROM_ABI void *
0 commit comments