From 49c3c40cc015fa85c97200ae8da2d7a9243bf351 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Sat, 3 Sep 2022 13:34:14 +0200 Subject: [PATCH] [NFC][libc++][format] Removes unused code. The code was for backwards compatibility with code no longer present in format. --- libcxx/include/format | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/libcxx/include/format b/libcxx/include/format index aad98892a06b..6ec60ff4b36a 100644 --- a/libcxx/include/format +++ b/libcxx/include/format @@ -308,22 +308,12 @@ __compile_time_validate_argument(basic_format_parse_context<_CharT>& __parse_ctx // exception of type format_error is thrown. // // Validate whether the arguments are integrals. - if constexpr (requires(formatter<_Tp, _CharT> __f) { __f.__width_needs_substitution(); }) { - // TODO FMT Remove this when parser v1 has been phased out. - if (__formatter.__width_needs_substitution()) - __format::__compile_time_validate_integral(__ctx.arg(__formatter.__width)); + if (__formatter.__parser_.__width_as_arg_) + __format::__compile_time_validate_integral(__ctx.arg(__formatter.__parser_.__width_)); - if constexpr (_HasPrecision) - if (__formatter.__precision_needs_substitution()) - __format::__compile_time_validate_integral(__ctx.arg(__formatter.__precision)); - } else { - if (__formatter.__parser_.__width_as_arg_) - __format::__compile_time_validate_integral(__ctx.arg(__formatter.__parser_.__width_)); - - if constexpr (_HasPrecision) - if (__formatter.__parser_.__precision_as_arg_) - __format::__compile_time_validate_integral(__ctx.arg(__formatter.__parser_.__precision_)); - } + if constexpr (_HasPrecision) + if (__formatter.__parser_.__precision_as_arg_) + __format::__compile_time_validate_integral(__ctx.arg(__formatter.__parser_.__precision_)); } template