Skip to content

Commit

Permalink
format (and friends) should reject volatile arguments (#2579)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyCarter committed Mar 4, 2022
1 parent 06514fc commit 4bb41db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stl/inc/format
Original file line number Diff line number Diff line change
Expand Up @@ -1493,10 +1493,10 @@ struct _Format_arg_traits {
// clang-format on

template <class _Ty>
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 <class _Ty>
static constexpr size_t _Storage_size = sizeof(_Storage_type<remove_cvref_t<_Ty>>);
static constexpr size_t _Storage_size = sizeof(_Storage_type<_Ty>);
};

struct _Format_arg_index {
Expand Down Expand Up @@ -1558,7 +1558,7 @@ private:

template <class _Ty>
void _Store(const size_t _Arg_index, _Ty&& _Val) noexcept {
using _Erased_type = typename _Traits::template _Storage_type<remove_cvref_t<_Ty>>;
using _Erased_type = typename _Traits::template _Storage_type<_Ty>;

_Basic_format_arg_type _Arg_type;
if constexpr (is_same_v<_Erased_type, bool>) {
Expand Down

0 comments on commit 4bb41db

Please sign in to comment.