diff --git a/stl/inc/format b/stl/inc/format index 7cc9369b03..42e9a36428 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -1493,10 +1493,10 @@ struct _Format_arg_traits { // clang-format on template - using _Storage_type = decltype(_Phony_basic_format_arg_constructor(_STD declval<_Ty>())); + using _Storage_type = decltype(_Phony_basic_format_arg_constructor(_STD declval<_Ty&>())); template - static constexpr size_t _Storage_size = sizeof(_Storage_type>); + static constexpr size_t _Storage_size = sizeof(_Storage_type<_Ty>); }; struct _Format_arg_index { @@ -1558,7 +1558,7 @@ private: template void _Store(const size_t _Arg_index, _Ty&& _Val) noexcept { - using _Erased_type = typename _Traits::template _Storage_type>; + using _Erased_type = typename _Traits::template _Storage_type<_Ty>; _Basic_format_arg_type _Arg_type; if constexpr (is_same_v<_Erased_type, bool>) {