[libcxx-commits] [libcxx] 49c3c40 - [NFC][libc++][format] Removes unused code.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sat Sep 3 04:35:07 PDT 2022


Author: Mark de Wever
Date: 2022-09-03T13:34:14+02:00
New Revision: 49c3c40cc015fa85c97200ae8da2d7a9243bf351

URL: https://github.com/llvm/llvm-project/commit/49c3c40cc015fa85c97200ae8da2d7a9243bf351
DIFF: https://github.com/llvm/llvm-project/commit/49c3c40cc015fa85c97200ae8da2d7a9243bf351.diff

LOG: [NFC][libc++][format] Removes unused code.

The code was for backwards compatibility with code no longer present in
format.

Added: 
    

Modified: 
    libcxx/include/format

Removed: 
    


################################################################################
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 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 (__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_));
 }
 
 template <class _CharT>


        


More information about the libcxx-commits mailing list