diff --git a/libcxx/include/__format/format_functions.h b/libcxx/include/__format/format_functions.h --- a/libcxx/include/__format/format_functions.h +++ b/libcxx/include/__format/format_functions.h @@ -101,7 +101,7 @@ // Before calling __parse the proper handler needs to be set with __enable. // The default handler isn't a core constant expression. _LIBCPP_HIDE_FROM_ABI constexpr __compile_time_handle() - : __parse_([](basic_format_parse_context<_CharT>&) { __throw_format_error("Not a handle"); }) {} + : __parse_([](basic_format_parse_context<_CharT>&) { std::__throw_format_error("Not a handle"); }) {} private: void (*__parse_)(basic_format_parse_context<_CharT>&); @@ -128,13 +128,13 @@ _LIBCPP_HIDE_FROM_ABI constexpr __arg_t arg(size_t __id) const { if (__id >= __size_) - __throw_format_error("Argument index out of bounds"); + std::__throw_format_error("Argument index out of bounds"); return __args_[__id]; } _LIBCPP_HIDE_FROM_ABI constexpr const __compile_time_handle<_CharT>& __handle(size_t __id) const { if (__id >= __size_) - __throw_format_error("Argument index out of bounds"); + std::__throw_format_error("Argument index out of bounds"); return __handles_[__id]; } @@ -159,7 +159,7 @@ return; default: - __throw_format_error("Argument isn't an integral type"); + std::__throw_format_error("Argument isn't an integral type"); } } @@ -191,7 +191,7 @@ __arg_t __type) { switch (__type) { case __arg_t::__none: - __throw_format_error("Invalid argument"); + std::__throw_format_error("Invalid argument"); case __arg_t::__boolean: return __format::__compile_time_validate_argument<_CharT, bool>(__parse_ctx, __ctx); case __arg_t::__char_type: @@ -204,7 +204,7 @@ # ifndef _LIBCPP_HAS_NO_INT128 return __format::__compile_time_validate_argument<_CharT, __int128_t>(__parse_ctx, __ctx); # else - __throw_format_error("Invalid argument"); + std::__throw_format_error("Invalid argument"); # endif return; case __arg_t::__unsigned: @@ -215,7 +215,7 @@ # ifndef _LIBCPP_HAS_NO_INT128 return __format::__compile_time_validate_argument<_CharT, __uint128_t>(__parse_ctx, __ctx); # else - __throw_format_error("Invalid argument"); + std::__throw_format_error("Invalid argument"); # endif return; case __arg_t::__float: @@ -231,9 +231,9 @@ case __arg_t::__ptr: return __format::__compile_time_validate_argument<_CharT, const void*>(__parse_ctx, __ctx); case __arg_t::__handle: - __throw_format_error("Handle should use __compile_time_validate_handle_argument"); + std::__throw_format_error("Handle should use __compile_time_validate_handle_argument"); } - __throw_format_error("Invalid argument"); + std::__throw_format_error("Invalid argument"); } template @@ -253,8 +253,7 @@ __parse_ctx.advance_to(__r.__ptr); break; default: - __throw_format_error( - "The replacement field arg-id should terminate at a ':' or '}'"); + std::__throw_format_error("The replacement field arg-id should terminate at a ':' or '}'"); } if constexpr (same_as<_Ctx, __compile_time_basic_format_context<_CharT>>) { @@ -267,7 +266,7 @@ _VSTD::__visit_format_arg( [&](auto __arg) { if constexpr (same_as) - __throw_format_error("Argument index out of bounds"); + std::__throw_format_error("Argument index out of bounds"); else if constexpr (same_as::handle>) __arg.format(__parse_ctx, __ctx); else { @@ -281,7 +280,7 @@ __begin = __parse_ctx.begin(); if (__begin == __end || *__begin != _CharT('}')) - __throw_format_error("The replacement field misses a terminating '}'"); + std::__throw_format_error("The replacement field misses a terminating '}'"); return ++__begin; } @@ -300,7 +299,7 @@ case _CharT('{'): ++__begin; if (__begin == __end) - __throw_format_error("The format string terminates at a '{'"); + std::__throw_format_error("The format string terminates at a '{'"); if (*__begin != _CharT('{')) [[likely]] { __ctx.advance_to(_VSTD::move(__out_it)); @@ -318,8 +317,7 @@ case _CharT('}'): ++__begin; if (__begin == __end || *__begin != _CharT('}')) - __throw_format_error( - "The format string contains an invalid escape sequence"); + std::__throw_format_error("The format string contains an invalid escape sequence"); break; } diff --git a/libcxx/include/__format/format_parse_context.h b/libcxx/include/__format/format_parse_context.h --- a/libcxx/include/__format/format_parse_context.h +++ b/libcxx/include/__format/format_parse_context.h @@ -54,8 +54,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr size_t next_arg_id() { if (__indexing_ == __manual) - __throw_format_error("Using automatic argument numbering in manual " - "argument numbering mode"); + std::__throw_format_error("Using automatic argument numbering in manual argument numbering mode"); if (__indexing_ == __unknown) __indexing_ = __automatic; @@ -63,8 +62,7 @@ } _LIBCPP_HIDE_FROM_ABI constexpr void check_arg_id(size_t __id) { if (__indexing_ == __automatic) - __throw_format_error("Using manual argument numbering in automatic " - "argument numbering mode"); + std::__throw_format_error("Using manual argument numbering in automatic argument numbering mode"); if (__indexing_ == __unknown) __indexing_ = __manual; @@ -77,7 +75,7 @@ // Note: the Throws clause [format.parse.ctx]/10 doesn't specify the // behavior when id >= num_args_. if (is_constant_evaluated() && __id >= __num_args_) - __throw_format_error("Argument index outside the valid range"); + std::__throw_format_error("Argument index outside the valid range"); } private: diff --git a/libcxx/include/__format/format_string.h b/libcxx/include/__format/format_string.h --- a/libcxx/include/__format/format_string.h +++ b/libcxx/include/__format/format_string.h @@ -120,7 +120,7 @@ if (__v > __number_max || (__begin != __end_input && *__begin >= _CharT('0') && *__begin <= _CharT('9'))) - __throw_format_error("The numeric value of the format-spec is too large"); + std::__throw_format_error("The numeric value of the format-spec is too large"); __value = __v; } @@ -149,8 +149,7 @@ return __detail::__parse_automatic(__begin, __end, __parse_ctx); } if (*__begin < _CharT('0') || *__begin > _CharT('9')) - __throw_format_error( - "The arg-id of the format-spec starts with an invalid character"); + std::__throw_format_error("The arg-id of the format-spec starts with an invalid character"); return __detail::__parse_manual(__begin, __end, __parse_ctx); } diff --git a/libcxx/include/__format/parser_std_format_spec.h b/libcxx/include/__format/parser_std_format_spec.h --- a/libcxx/include/__format/parser_std_format_spec.h +++ b/libcxx/include/__format/parser_std_format_spec.h @@ -52,12 +52,12 @@ // This function is a wrapper to call the real parser. But it does the // validation for the pre-conditions and post-conditions. if (__begin == __end) - __throw_format_error("End of input while parsing format-spec arg-id"); + std::__throw_format_error("End of input while parsing format-spec arg-id"); __format::__parse_number_result __r = __format::__parse_arg_id(__begin, __end, __parse_ctx); if (__r.__ptr == __end || *__r.__ptr != _CharT('}')) - __throw_format_error("Invalid arg-id"); + std::__throw_format_error("Invalid arg-id"); ++__r.__ptr; return __r; @@ -80,22 +80,19 @@ if constexpr (integral<_Type>) { if constexpr (signed_integral<_Type>) { if (__arg < 0) - __throw_format_error("A format-spec arg-id replacement shouldn't " - "have a negative value"); + std::__throw_format_error("A format-spec arg-id replacement shouldn't have a negative value"); } using _CT = common_type_t<_Type, decltype(__format::__number_max)>; if (static_cast<_CT>(__arg) > static_cast<_CT>(__format::__number_max)) - __throw_format_error("A format-spec arg-id replacement exceeds " - "the maximum supported value"); + std::__throw_format_error("A format-spec arg-id replacement exceeds the maximum supported value"); return __arg; } else if constexpr (same_as<_Type, monostate>) - __throw_format_error("Argument index out of bounds"); + std::__throw_format_error("Argument index out of bounds"); else - __throw_format_error("A format-spec arg-id replacement argument " - "isn't an integral type"); + std::__throw_format_error("A format-spec arg-id replacement argument isn't an integral type"); }, __format_arg); } @@ -287,7 +284,7 @@ // parsing. In that case that parser should do the end of format string // validation. if (__begin != __end && *__begin != _CharT('}')) - __throw_format_error("The format-spec should consume the input or end with a '}'"); + std::__throw_format_error("The format-spec should consume the input or end with a '}'"); } return __begin; @@ -373,7 +370,7 @@ if (__begin + 1 != __end) { if (__parse_alignment(*(__begin + 1))) { if (*__begin == _CharT('{') || *__begin == _CharT('}')) - __throw_format_error("The format-spec fill field contains an invalid character"); + std::__throw_format_error("The format-spec fill field contains an invalid character"); __fill_ = *__begin; __begin += 2; @@ -427,7 +424,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_width(const _CharT*& __begin, const _CharT* __end, auto& __parse_ctx) { if (*__begin == _CharT('0')) - __throw_format_error("A format-spec width field shouldn't have a leading zero"); + std::__throw_format_error("A format-spec width field shouldn't have a leading zero"); if (*__begin == _CharT('{')) { __format::__parse_number_result __r = __format_spec::__parse_arg_id(++__begin, __end, __parse_ctx); @@ -455,7 +452,7 @@ ++__begin; if (__begin == __end) - __throw_format_error("End of input while parsing format-spec precision"); + std::__throw_format_error("End of input while parsing format-spec precision"); if (*__begin == _CharT('{')) { __format::__parse_number_result __arg_id = __format_spec::__parse_arg_id(++__begin, __end, __parse_ctx); @@ -466,7 +463,7 @@ } if (*__begin < _CharT('0') || *__begin > _CharT('9')) - __throw_format_error("The format-spec precision field doesn't contain a value or arg-id"); + std::__throw_format_error("The format-spec precision field doesn't contain a value or arg-id"); __format::__parse_number_result __r = __format::__parse_number(__begin, __end); __precision_ = __r.__value;