[libcxx-commits] [libcxx] [libc++] Implement LWG4257: Stream insertion for chrono local_time should be constrained (PR #230811)

Lucas Mellone via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 23 01:54:06 PDT 2026


================
@@ -215,8 +216,38 @@ static void test_ja_JP() {
              std::chrono::duration<long long, std::ratio<1, 100>>{12'345'678'9010}}) == SV("2009-02-13 23:31:30.10"));
 }
 
+template <class CharT, class T>
+concept is_ostreamable = requires(std::basic_ostream<CharT>& os, T const& val) {
+  { os << val };
+};
+
 template <class CharT>
 static void test() {
+  // Test local_time's constraints:
----------------
lknknm wrote:

Can/should we make it in such a way we test for LWG4257 explicitly? Either by changing the comment to `Test LWG4257 constraints` or moving it to `test_lwg4257()`?

https://github.com/llvm/llvm-project/pull/230811


More information about the libcxx-commits mailing list