[libcxx-commits] [libcxx] b927fba - [libc++][test] Improves handle formatter.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 19 05:04:25 PDT 2022


Author: Mark de Wever
Date: 2022-03-19T13:04:19+01:00
New Revision: b927fba16fc3be9b276bd771e0d3ff7cc625ea51

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

LOG: [libc++][test] Improves handle formatter.

Before it only accepted one output iterator type. Now it accepts all
output iterator types as required by BasicFormatter.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D120916

Added: 
    

Modified: 
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp
index 9f27b25165423..4f3c94eaabfcf 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp
@@ -31,9 +31,7 @@ const char* color_names[] = {"black", "red", "gold"};
 
 template <>
 struct std::formatter<color> : std::formatter<const char*> {
-  auto format(color c, format_context& ctx) {
-    return formatter<const char*>::format(color_names[static_cast<int>(c)], ctx);
-  }
+  auto format(color c, auto& ctx) { return formatter<const char*>::format(color_names[static_cast<int>(c)], ctx); }
 };
 
 void test(std::string expected, std::string_view fmt, color arg) {


        


More information about the libcxx-commits mailing list