[llvm-branch-commits] [libcxx] [libc++][TZDB] Finishes zoned_time constructors. (PR #95010)

2024-07-07 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante edited 
https://github.com/llvm/llvm-project/pull/95010
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][TZDB] Finishes zoned_time constructors. (PR #95010)

2024-07-07 Thread Mark de Wever via llvm-branch-commits


@@ -76,12 +81,71 @@ class zoned_time {
 
   _LIBCPP_HIDE_FROM_ABI explicit zoned_time(string_view __name)
 requires(requires { __traits::locate_zone(string_view{}); } &&
- // constructible_from
- // would create a dependency on itself. Instead depend on the fact
- // a constructor taking a _TimeZonePtr exists.
  constructible_from<_TimeZonePtr, 
decltype(__traits::locate_zone(string_view{}))>)
   : __zone_{__traits::locate_zone(__name)}, __tp_{} {}
 
+  template 
+  _LIBCPP_HIDE_FROM_ABI zoned_time(const zoned_time<_Duration2, _TimeZonePtr>& 
__zt)
+requires is_convertible_v, sys_time<_Duration>>
+  : __zone_{__zt.get_time_zone()}, __tp_{__zt.get_sys_time()} {}
+
+  _LIBCPP_HIDE_FROM_ABI zoned_time(_TimeZonePtr __zone, const 
sys_time<_Duration>& __tp)
+  : __zone_{std::move(__zone)}, __tp_{__tp} {}
+
+  _LIBCPP_HIDE_FROM_ABI zoned_time(string_view __name, const 
sys_time<_Duration>& __tp)
+requires requires { _TimeZonePtr{__traits::locate_zone(string_view{})}; }
+  : zoned_time{__traits::locate_zone(__name), __tp} {}
+
+  _LIBCPP_HIDE_FROM_ABI zoned_time(_TimeZonePtr __zone, const 
local_time<_Duration>& __tp)
+requires(is_convertible_v() -> 
to_sys(local_time<_Duration>{})),
+  sys_time>)
+  : __zone_{std::move(__zone)}, __tp_{__zone_->to_sys(__tp)} {}
+
+  _LIBCPP_HIDE_FROM_ABI zoned_time(string_view __name, const 
local_time<_Duration>& __tp)
+requires(requires {
+  _TimeZonePtr{__traits::locate_zone(string_view{})};
+} && is_convertible_v() -> 
to_sys(local_time<_Duration>{})),

mordante wrote:

See the comment about this in the parent patch. I'll mark the similar comments 
as resolved.

https://github.com/llvm/llvm-project/pull/95010
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][TZDB] Finishes zoned_time constructors. (PR #95010)

2024-07-07 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante commented:

> Peanut gallery comment: it would be very cool if `zoned_time` could make it 
> for libcxx 19; 🤞 It's IMO one of the most useful classes in ``.

I hope to get `zoned_time` and the missing clocks ready before LLVM-19. However 
it will be closer to the deadline than I hoped.

https://github.com/llvm/llvm-project/pull/95010
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][TZDB] Finishes zoned_time constructors. (PR #95010)

2024-07-07 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/95010

>From 6d6dade0997a414431bf852742cd68c24d274e27 Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Wed, 17 Apr 2024 21:00:22 +0200
Subject: [PATCH] [libc++][TZDB] Finishes zoned_time constructors.

Completes
- LWG3225 zoned_time converting constructor shall not be noexcept
- LWG3226 zoned_time constructor from string_view should accept 
zoned_time

Implements parts of:
- P0355 Extending to chrono Calendars and Time Zones
---
 libcxx/docs/Status/Cxx20Issues.csv|   4 +-
 libcxx/include/__chrono/zoned_time.h  |  73 ++-
 .../test_offset_time_zone.h   |  10 +
 .../string_view_local_time.pass.cpp   |  74 +++
 .../string_view_local_time_choose.pass.cpp| 100 ++
 .../string_view_sys_time.pass.cpp |  74 +++
 ...ned_time_duration2_time_zone_ptr2.pass.cpp | 159 +++
 ...e_duration2_time_zone_ptr2_choose.pass.cpp | 181 ++
 .../time_zone_pointer_local_time.pass.cpp |  82 
 ...me_zone_pointer_local_time_choose.pass.cpp | 104 ++
 .../time_zone_pointer_sys_time.pass.cpp   |  88 +
 ...ned_time_duration2_time_zone_ptr2.pass.cpp | 105 ++
 ...e_duration2_time_zone_ptr2_choose.pass.cpp | 117 +++
 .../zoned_time_duration2.pass.cpp |  88 +
 14 files changed, 1252 insertions(+), 7 deletions(-)
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/string_view_local_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/string_view_local_time_choose.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/string_view_sys_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/string_view_zoned_time_duration2_time_zone_ptr2.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/string_view_zoned_time_duration2_time_zone_ptr2_choose.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/time_zone_pointer_local_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/time_zone_pointer_local_time_choose.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/time_zone_pointer_sys_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/time_zone_ptr_zoned_time_duration2_time_zone_ptr2.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/time_zone_ptr_zoned_time_duration2_time_zone_ptr2_choose.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.ctor/zoned_time_duration2.pass.cpp

diff --git a/libcxx/docs/Status/Cxx20Issues.csv 
b/libcxx/docs/Status/Cxx20Issues.csv
index 5732d5b5dd0564..faae05d3380cc3 100644
--- a/libcxx/docs/Status/Cxx20Issues.csv
+++ b/libcxx/docs/Status/Cxx20Issues.csv
@@ -162,7 +162,7 @@
 "`3209 `__","Expression in ``year::ok()``\  returns 
clause is ill-formed","Cologne","|Complete|",""
 "","","","","",""
 "`3231 `__","``year_month_day_last::day``\  
specification does not cover ``!ok()``\  values","Belfast","|Nothing To Do|",""
-"`3225 `__","``zoned_time``\  converting 
constructor shall not be ``noexcept``\ ","Belfast","","","|chrono|"
+"`3225 `__","``zoned_time``\  converting 
constructor shall not be ``noexcept``\ 
","Belfast","|Complete|","19.0","|chrono|"
 "`3190 `__","``std::allocator::allocate``\  
sometimes returns too little storage","Belfast","|Complete|","14.0"
 "`3218 `__","Modifier for ``%d``\  parse flag does 
not match POSIX and ``format``\  specification","Belfast","","","|chrono| 
|format|"
 "`3224 `__","``zoned_time``\  constructor from 
``TimeZonePtr``\  does not specify initialization of ``tp_``\ 
","Belfast","|Complete|","19.0","|chrono|"
@@ -199,7 +199,7 @@
 "`3194 `__","``ConvertibleTo``\  prose does not 
match code","Prague","|Complete|","13.0"
 "`3200 `__","``midpoint``\  should not constrain 
``T``\  is complete","Prague","|Nothing To Do|",""
 "`3201 `__","``lerp``\  should be marked as 
``noexcept``\ ","Prague","|Complete|",""
-"`3226 `__","``zoned_time``\  constructor from 
``string_view``\  should accept ``zoned_time``\ 
","Prague","","","|chrono|"
+"`3226 `__","``zoned_time``\  constructor from 
``string_view``\  should accept ``zoned_time``\ 
","Prague","|C

[llvm-branch-commits] [libcxx] [libc++][TZDB] Finishes zoned_time member functions. (PR #95026)

2024-07-07 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/95026

>From 3dcb1871f7c4281cc0adfd61f4005c686614c307 Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Wed, 17 Apr 2024 21:00:22 +0200
Subject: [PATCH] [libc++][TZDB] Finishes zoned_time member functions.

Note the implementation of
  zoned_time& operator=(const local_time& lt);
is not correct; however the wording cannot be easily implemented. It could
be if the object caches the local_time assigned. However this does not
seem to intended. The current implementation matches MSVC STL and
libstdc++.

Implements parts of:
- P0355 Extending to chrono Calendars and Time Zones
---
 libcxx/include/__chrono/zoned_time.h  |  22 ++
 .../diagnostics/chrono.nodiscard.verify.cpp   |  12 +-
 .../assign.local_time.pass.cpp| 245 ++
 .../assign.sys_time.pass.cpp  | 136 ++
 .../get_info.pass.cpp |  51 
 .../get_local_time.pass.cpp   | 133 ++
 .../operator_local_time.pass.cpp  | 135 ++
 .../operator_sys_time.pass.cpp| 125 +
 8 files changed, 857 insertions(+), 2 deletions(-)
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/assign.local_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/assign.sys_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/get_info.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/get_local_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/operator_local_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/operator_sys_time.pass.cpp

diff --git a/libcxx/include/__chrono/zoned_time.h 
b/libcxx/include/__chrono/zoned_time.h
index 08f7f37603920..101a9f52966ad 100644
--- a/libcxx/include/__chrono/zoned_time.h
+++ b/libcxx/include/__chrono/zoned_time.h
@@ -18,6 +18,7 @@
 
 #  include <__chrono/calendar.h>
 #  include <__chrono/duration.h>
+#  include <__chrono/sys_info.h>
 #  include <__chrono/system_clock.h>
 #  include <__chrono/time_zone.h>
 #  include <__chrono/tzdb_list.h>
@@ -147,8 +148,29 @@ class zoned_time {
 } && is_convertible_v, sys_time<_Duration>>)
   : zoned_time{__traits::locate_zone(__name), __zt, __c} {}
 
+  _LIBCPP_HIDE_FROM_ABI zoned_time& operator=(const sys_time<_Duration>& __tp) 
{
+__tp_ = __tp;
+return *this;
+  }
+
+  _LIBCPP_HIDE_FROM_ABI zoned_time& operator=(const local_time<_Duration>& 
__tp) {
+// TODO TZDB This seems wrong.
+// Assigning a non-existant or abiguous time will throw and not satisfy
+// the post condition. This seems quite odd; I constructed an object with
+// choose::earliest and that choice is not respected.
+// what did LEWG do with this.
+// MSVC STL and libstdc++ behave the same
+__tp_ = __zone_->to_sys(__tp);
+return *this;
+  }
+
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI operator sys_time() const { 
return get_sys_time(); }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit operator local_time() 
const { return get_local_time(); }
+
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _TimeZonePtr get_time_zone() const { 
return __zone_; }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI local_time get_local_time() 
const { return __zone_->to_local(__tp_); }
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI sys_time get_sys_time() const 
{ return __tp_; }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI sys_info get_info() const { return 
__zone_->get_info(__tp_); }
 
 private:
   _TimeZonePtr __zone_;
diff --git a/libcxx/test/libcxx/diagnostics/chrono.nodiscard.verify.cpp 
b/libcxx/test/libcxx/diagnostics/chrono.nodiscard.verify.cpp
index e8337cb33822e..32a67dc4dc9c4 100644
--- a/libcxx/test/libcxx/diagnostics/chrono.nodiscard.verify.cpp
+++ b/libcxx/test/libcxx/diagnostics/chrono.nodiscard.verify.cpp
@@ -81,7 +81,15 @@ void test() {
 
   {
 std::chrono::zoned_time zt;
-zt.get_time_zone(); // expected-warning {{ignoring return value of 
function declared with 'nodiscard' attribute}}
-zt.get_sys_time();  // expected-warning {{ignoring return value of 
function declared with 'nodiscard' attribute}}
+
+// expected-warning@+1 {{ignoring return value of function declared with 
'nodiscard' attribute}}
+static_cast(zt);
+// expected-warning@+1 {{ignoring return value of function declared with 
'nodiscard' attribute}}
+static_cast(zt);
+
+zt.get_time_zone();  // expected-warning {{ignoring return value of 
function declared with 'nodiscard' attribute}}
+zt.get_local_time(); // expected-warning {{ignoring return value of 
function declared with 'nodiscard' attribute}}
+zt.get_sys_time();   // expected-warning {{ignoring return value 

[llvm-branch-commits] [libcxx] [libc++][TZDB] Finishes zoned_time member functions. (PR #95026)

2024-07-07 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/95026

>From 5195d3905de900a09a9c78ee843c28f0939cdf62 Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Wed, 17 Apr 2024 21:00:22 +0200
Subject: [PATCH] [libc++][TZDB] Finishes zoned_time member functions.

Note the implementation of
  zoned_time& operator=(const local_time& lt);
is not correct; however the wording cannot be easily implemented. It could
be if the object caches the local_time assigned. However this does not
seem to intended. The current implementation matches MSVC STL and
libstdc++.

Implements parts of:
- P0355 Extending to chrono Calendars and Time Zones
---
 libcxx/include/__chrono/zoned_time.h  |  22 ++
 .../diagnostics/chrono.nodiscard.verify.cpp   |  12 +-
 .../assign.local_time.pass.cpp| 243 ++
 .../assign.sys_time.pass.cpp  | 136 ++
 .../get_info.pass.cpp |  51 
 .../get_local_time.pass.cpp   | 133 ++
 .../operator_local_time.pass.cpp  | 135 ++
 .../operator_sys_time.pass.cpp| 125 +
 8 files changed, 855 insertions(+), 2 deletions(-)
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/assign.local_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/assign.sys_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/get_info.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/get_local_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/operator_local_time.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.members/operator_sys_time.pass.cpp

diff --git a/libcxx/include/__chrono/zoned_time.h 
b/libcxx/include/__chrono/zoned_time.h
index 08f7f37603920..101a9f52966ad 100644
--- a/libcxx/include/__chrono/zoned_time.h
+++ b/libcxx/include/__chrono/zoned_time.h
@@ -18,6 +18,7 @@
 
 #  include <__chrono/calendar.h>
 #  include <__chrono/duration.h>
+#  include <__chrono/sys_info.h>
 #  include <__chrono/system_clock.h>
 #  include <__chrono/time_zone.h>
 #  include <__chrono/tzdb_list.h>
@@ -147,8 +148,29 @@ class zoned_time {
 } && is_convertible_v, sys_time<_Duration>>)
   : zoned_time{__traits::locate_zone(__name), __zt, __c} {}
 
+  _LIBCPP_HIDE_FROM_ABI zoned_time& operator=(const sys_time<_Duration>& __tp) 
{
+__tp_ = __tp;
+return *this;
+  }
+
+  _LIBCPP_HIDE_FROM_ABI zoned_time& operator=(const local_time<_Duration>& 
__tp) {
+// TODO TZDB This seems wrong.
+// Assigning a non-existant or abiguous time will throw and not satisfy
+// the post condition. This seems quite odd; I constructed an object with
+// choose::earliest and that choice is not respected.
+// what did LEWG do with this.
+// MSVC STL and libstdc++ behave the same
+__tp_ = __zone_->to_sys(__tp);
+return *this;
+  }
+
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI operator sys_time() const { 
return get_sys_time(); }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI explicit operator local_time() 
const { return get_local_time(); }
+
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _TimeZonePtr get_time_zone() const { 
return __zone_; }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI local_time get_local_time() 
const { return __zone_->to_local(__tp_); }
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI sys_time get_sys_time() const 
{ return __tp_; }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI sys_info get_info() const { return 
__zone_->get_info(__tp_); }
 
 private:
   _TimeZonePtr __zone_;
diff --git a/libcxx/test/libcxx/diagnostics/chrono.nodiscard.verify.cpp 
b/libcxx/test/libcxx/diagnostics/chrono.nodiscard.verify.cpp
index e8337cb33822e..32a67dc4dc9c4 100644
--- a/libcxx/test/libcxx/diagnostics/chrono.nodiscard.verify.cpp
+++ b/libcxx/test/libcxx/diagnostics/chrono.nodiscard.verify.cpp
@@ -81,7 +81,15 @@ void test() {
 
   {
 std::chrono::zoned_time zt;
-zt.get_time_zone(); // expected-warning {{ignoring return value of 
function declared with 'nodiscard' attribute}}
-zt.get_sys_time();  // expected-warning {{ignoring return value of 
function declared with 'nodiscard' attribute}}
+
+// expected-warning@+1 {{ignoring return value of function declared with 
'nodiscard' attribute}}
+static_cast(zt);
+// expected-warning@+1 {{ignoring return value of function declared with 
'nodiscard' attribute}}
+static_cast(zt);
+
+zt.get_time_zone();  // expected-warning {{ignoring return value of 
function declared with 'nodiscard' attribute}}
+zt.get_local_time(); // expected-warning {{ignoring return value of 
function declared with 'nodiscard' attribute}}
+zt.get_sys_time();   // expected-warning {{ignoring return value 

[llvm-branch-commits] [libcxx] [libc++][TZDB] Adds zoned_time deduction guides. (PR #95139)

2024-07-07 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/95139

>From 072f4561a2ee3a48dc0754f50ecdec4dbba59421 Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Wed, 17 Apr 2024 21:00:22 +0200
Subject: [PATCH] [libc++][TZDB] Adds zoned_time deduction guides.

Completes
- LWG3232 Inconsistency in zoned_time  deduction guides
- LWG3294 zoned_time  deduction guides misinterprets stringchar*

Implements parts of:
- P0355 Extending to chrono Calendars and Time Zones
---
 libcxx/docs/Status/Cxx20Issues.csv|   4 +-
 libcxx/include/__chrono/zoned_time.h  |  28 ++
 .../time.zone.zonedtime/deduction.pass.cpp| 248 ++
 3 files changed, 278 insertions(+), 2 deletions(-)
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/deduction.pass.cpp

diff --git a/libcxx/docs/Status/Cxx20Issues.csv 
b/libcxx/docs/Status/Cxx20Issues.csv
index faae05d3380cc..1a40a4472a405 100644
--- a/libcxx/docs/Status/Cxx20Issues.csv
+++ b/libcxx/docs/Status/Cxx20Issues.csv
@@ -167,7 +167,7 @@
 "`3218 `__","Modifier for ``%d``\  parse flag does 
not match POSIX and ``format``\  specification","Belfast","","","|chrono| 
|format|"
 "`3224 `__","``zoned_time``\  constructor from 
``TimeZonePtr``\  does not specify initialization of ``tp_``\ 
","Belfast","|Complete|","19.0","|chrono|"
 "`3230 `__","Format specifier ``%y/%Y``\  is 
missing locale alternative versions","Belfast","|Complete|","16.0","|chrono| 
|format|"
-"`3232 `__","Inconsistency in ``zoned_time``\  
deduction guides","Belfast","","","|chrono|"
+"`3232 `__","Inconsistency in ``zoned_time``\  
deduction guides","Belfast","|Complete|","19.0","|chrono|"
 "`3222 `__","P0574R1 introduced preconditions on 
non-existent parameters","Belfast","",""
 "`3221 `__","Result of ``year_month``\  arithmetic 
with ``months``\  is ambiguous","Belfast","|Complete|","8.0"
 "`3235 `__","``parse``\  manipulator without 
abbreviation is not callable","Belfast","",""
@@ -225,7 +225,7 @@
 "`3286 `__","``ranges::size``\  is not required to 
be valid after a call to ``ranges::begin``\  on an input 
range","Prague","|Complete|","15.0","|ranges|"
 "`3291 `__","``iota_view::iterator``\  has the 
wrong ``iterator_category``\ ","Prague","|Complete|","15.0","|ranges|"
 "`3292 `__","``iota_view``\  is 
under-constrained","Prague","|Complete|","15.0","|ranges|"
-"`3294 `__","``zoned_time``\  deduction guides 
misinterprets ``string``\ /``char*``\ ","Prague","","","|chrono|"
+"`3294 `__","``zoned_time``\  deduction guides 
misinterprets ``string``\ /``char*``\ ","Prague","|Complete|","19.0","|chrono|"
 "`3296 `__","Inconsistent default argument for 
``basic_regex<>::assign``\ ","Prague","|Complete|",""
 "`3299 `__","Pointers don't need customized 
iterator behavior","Prague","|Complete|","15.0","|ranges|"
 "`3300 `__","Non-array ``ssize``\  overload is 
underconstrained","Prague","|Nothing To Do|",""
diff --git a/libcxx/include/__chrono/zoned_time.h 
b/libcxx/include/__chrono/zoned_time.h
index 101a9f52966ad..7a13c4e3a3dee 100644
--- a/libcxx/include/__chrono/zoned_time.h
+++ b/libcxx/include/__chrono/zoned_time.h
@@ -25,6 +25,8 @@
 #  include <__config>
 #  include <__fwd/string_view.h>
 #  include <__type_traits/common_type.h>
+#  include <__type_traits/conditional.h>
+#  include <__type_traits/remove_cvref.h>
 #  include <__utility/move.h>
 
 #  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -177,6 +179,32 @@ class zoned_time {
   sys_time __tp_;
 };
 
+zoned_time() -> zoned_time;
+
+template 
+zoned_time(sys_time<_Duration>) -> zoned_time>;
+
+template 
+using __time_zone_representation =
+conditional_t,
+  const time_zone*,
+  remove_cvref_t<_TimeZonePtrOrName>>;
+
+template 
+zoned_time(_TimeZonePtrOrName&&) -> zoned_time>;
+
+template 
+zoned_time(_TimeZonePtrOrName&&, sys_time<_Duration>)
+-> zoned_time, 
__time_zone_representation<_TimeZonePtrOrName>>;
+
+template 
+zoned_time(_TimeZonePtrOrName&&, local_time<_Duration>, choose = 
choose::earliest)
+-> zoned_time, 
__time_zone_representation<_TimeZonePtrOrName>>;
+
+template 
+zoned_time(_TimeZonePtrOrName&&, zoned_time<_Duration, TimeZonePtr2>, choose = 
choose::earliest)
+-> zoned_time, 
__time_zone_representation<_TimeZonePtrOrName>>;
+
 } // namespace chrono
 
 #  endif // _LIBCPP_STD_VER >= 20 && 
!defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && 
!defined(_LIBCPP_HAS_NO_FILESYSTEM)
diff --git 
a/libcxx/test/std/time/time.zone/time.zone.zonedtime/deduction.pass.cpp 
b/libcxx/test/std/time/time.zone/ti

[llvm-branch-commits] [libcxx] [libc++][TZDB] Implements zoned_time's operator==. (PR #95140)

2024-07-07 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/95140

>From 24e1151d23ba3b6b72461498ababb8b0821422ae Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Wed, 17 Apr 2024 21:00:22 +0200
Subject: [PATCH] [libc++][TZDB] Implements zoned_time's operator==.

Implements parts of:
- P0355 Extending to chrono Calendars and Time Zones
- P1614R2 The Mothership has Landed
---
 libcxx/docs/Status/SpaceshipProjects.csv  |  4 +-
 libcxx/include/__chrono/zoned_time.h  |  6 ++
 libcxx/include/chrono |  4 ++
 .../eq.pass.cpp   | 71 +++
 4 files changed, 83 insertions(+), 2 deletions(-)
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.nonmembers/eq.pass.cpp

diff --git a/libcxx/docs/Status/SpaceshipProjects.csv 
b/libcxx/docs/Status/SpaceshipProjects.csv
index 128b23b0c2c74f..74441dcdea4966 100644
--- a/libcxx/docs/Status/SpaceshipProjects.csv
+++ b/libcxx/docs/Status/SpaceshipProjects.csv
@@ -140,7 +140,7 @@ Section,Description,Dependencies,Assignee,Complete
 "| `[class.slice.overview] `_
 | `[slice.ops] `_",| `slice 
`_,None,Hristo Hristov,|Complete|
 - `5.12 Clause 27: Time library 
`_
-| `[time.syn] `_,|,None,Mark de Wever,|In Progress|
+| `[time.syn] `_,|,None,Mark de Wever,|Complete|
 | `[time.duration.comparisons] 
`_, `chrono::duration 
`_, None, Hristo Hristov, |Complete|
 | `[time.point.comparisons] `_, 
`chrono::time_point `_, None, Hristo Hristov, 
|Complete|
 "| `[time.cal.day.nonmembers] `_
@@ -172,7 +172,7 @@ Section,Description,Dependencies,Assignee,Complete
 | `year_month_weekday `_
 | `year_month_weekday_last `_",None,Hristo 
Hristov,|Complete|
 `[time.zone.nonmembers] 
`_,"`chrono::time_zone`",,Mark de 
Wever,|Complete|
-`[time.zone.zonedtime.nonmembers] 
`_,"`chrono::zoned_time`",A 
 implementation,Mark de Wever,|In Progress|
+`[time.zone.zonedtime.nonmembers] 
`_,"`chrono::zoned_time`",,Mark
 de Wever,|Complete|
 `[time.zone.leap.nonmembers] 
`_,"`chrono::time_leap_seconds`",,Mark
 de Wever,|Complete|
 `[time.zone.link.nonmembers] 
`_,"`chrono::time_zone_link`",,Mark
 de Wever,|Complete|
 - `5.13 Clause 28: Localization library 
`_
diff --git a/libcxx/include/__chrono/zoned_time.h 
b/libcxx/include/__chrono/zoned_time.h
index 7a13c4e3a3dee6..9be206db75931c 100644
--- a/libcxx/include/__chrono/zoned_time.h
+++ b/libcxx/include/__chrono/zoned_time.h
@@ -205,6 +205,12 @@ template 
 zoned_time(_TimeZonePtrOrName&&, zoned_time<_Duration, TimeZonePtr2>, choose = 
choose::earliest)
 -> zoned_time, 
__time_zone_representation<_TimeZonePtrOrName>>;
 
+template 
+_LIBCPP_HIDE_FROM_ABI bool
+operator==(const zoned_time<_Duration1, _TimeZonePtr>& __lhs, const 
zoned_time<_Duration2, _TimeZonePtr>& __rhs) {
+  return __lhs.get_time_zone() == __rhs.get_time_zone() && 
__lhs.get_sys_time() == __rhs.get_sys_time();
+}
+
 } // namespace chrono
 
 #  endif // _LIBCPP_STD_VER >= 20 && 
!defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && 
!defined(_LIBCPP_HAS_NO_FILESYSTEM)
diff --git a/libcxx/include/chrono b/libcxx/include/chrono
index f377a57a024975..68a7fe3cc09b3d 100644
--- a/libcxx/include/chrono
+++ b/libcxx/include/chrono
@@ -793,6 +793,10 @@ template struct zoned_traits;
 template 
  // C++20
 class zoned_time;
 
+template  
  // C++20
+  bool operator==(const zoned_time& x,
+  const zoned_time& y);
+
 // [time.zone.leap], leap second support
 class leap_second {
  // C++20
 public:
diff --git 
a/libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.nonmembers/eq.pass.cpp
 
b/libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.nonmembers/eq.pass.cpp
new file mode 100644
index 00..2ccb060d24ee68
--- /dev/null
+++ 
b/libcxx/test/std/time/time.zone/time.zone.zonedtime/time.zone.zonedtime.nonmembers/eq.pass.cpp
@@ -0,0 +1,71 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information

[llvm-branch-commits] [llvm] [llvm-objcopy] Support CREL (PR #97521)

2024-07-07 Thread James Henderson via llvm-branch-commits

https://github.com/jh7370 approved this pull request.

LGTM!

https://github.com/llvm/llvm-project/pull/97521
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm-objdump] -r: support CREL (PR #97382)

2024-07-07 Thread James Henderson via llvm-branch-commits

https://github.com/jh7370 approved this pull request.

LGTM!

https://github.com/llvm/llvm-project/pull/97382
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits