Skip to content

[libc++][NFC] Mark P1424R1 as partially implemented #107751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

H-G-Hristov
Copy link
Contributor

@H-G-Hristov H-G-Hristov commented Sep 8, 2024

hh_mm_ss and related functions from https://wg21.link/P1466R3 was partially implemented in LLVM 10 fde236b

// 27.9, class template time_of_dayhh_mm_ss
template <class Duration> hh_mm_ss;

// 27.10, 12/24 hour functions
constexpr bool is_am(const hours& h) noexcept;
constexpr bool is_pm(const hours& h) noexcept;
constexpr hours make12(const hours& h) noexcept;
constexpr hours make24(const hours& h, bool is_pm) noexcept;

Accessors added in db99d3a (operator << is not implemented)

Modify 27.8.6.2 [time.cal.wd.members] as indicated:

constexpr explicit weekday(unsigned wd) noexcept;
Effects: Constructs an object of type weekday by initializing wd_ with wd == 7 ? 0 : wd. The value held is unspecified if wd is not in the range [0, 255].

constexpr explicit operator unsigned() const noexcept;
Returns: wd_.

constexpr unsigned c_encoding() const noexcept;
Returns: wd_.

constexpr unsigned iso_encoding() const noexcept;
Returns: wd_ == 0u ? 7u : wd_.

Modify 27.8.6.3 [time.cal.wd.nonmembers] as indicated:

constexpr bool operator==(const weekday& x, const weekday& y) noexcept;
Returns: unsigned{x} == unsigned{y} x.wd_ == y.wd_.

constexpr weekday operator+(const weekday& x, const days& y) noexcept;
Returns: weekday{modulo(static_cast<long long>(unsigned{x.wd_}) + y.count(), 7)}.

template<class charT, class traits>
  basic_ostream<charT, traits>&
    operator<<(basic_ostream<charT, traits>& os, const weekday& wd);
Effects: If wd.ok() == true inserts format(os.getloc(), fmt, wd) where fmt is "%a" widened to charT. Otherwise inserts unsigned{wd.wd_} << " is not a valid weekday".

Reference:

@H-G-Hristov H-G-Hristov marked this pull request as ready for review September 8, 2024 11:57
@H-G-Hristov H-G-Hristov requested a review from a team as a code owner September 8, 2024 11:57
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 8, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 8, 2024

@llvm/pr-subscribers-libcxx

Author: Hristo Hristov (H-G-Hristov)

Changes

hh_mm_ss and related functions from https://wg21.link/P1466R3 was partially implemented in LLVM 10

Reference: #100015


Full diff: https://github.com/llvm/llvm-project/pull/107751.diff

1 Files Affected:

  • (modified) libcxx/docs/Status/Cxx20Papers.csv (+1-1)
diff --git a/libcxx/docs/Status/Cxx20Papers.csv b/libcxx/docs/Status/Cxx20Papers.csv
index ad788d7416fdad..721bf9d69a3a45 100644
--- a/libcxx/docs/Status/Cxx20Papers.csv
+++ b/libcxx/docs/Status/Cxx20Papers.csv
@@ -118,7 +118,7 @@
 "`P1361R2 <https://wg21.link/P1361R2>`__","Integration of chrono with text formatting","2019-07 (Cologne)","|Partial|","",""
 "`P1423R3 <https://wg21.link/P1423R3>`__","char8_t backward compatibility remediation","2019-07 (Cologne)","|Complete|","15.0",""
 "`P1424R1 <https://wg21.link/P1424R1>`__","'constexpr' feature macro concerns","2019-07 (Cologne)","|Nothing To Do|","","Superseded by `P1902 <https://wg21.link/P1902>`__"
-"`P1466R3 <https://wg21.link/P1466R3>`__","Miscellaneous minor fixes for chrono","2019-07 (Cologne)","","",""
+"`P1466R3 <https://wg21.link/P1466R3>`__","Miscellaneous minor fixes for chrono","2019-07 (Cologne)","|Partial|","","`hh_mm_ss` implemented in LLVM 10"
 "`P1474R1 <https://wg21.link/P1474R1>`__","Helpful pointers for ContiguousIterator","2019-07 (Cologne)","|Complete|","15.0",""
 "`P1502R1 <https://wg21.link/P1502R1>`__","Standard library header units for C++20","2019-07 (Cologne)","","",""
 "`P1522R1 <https://wg21.link/P1522R1>`__","Iterator Difference Type and Integer Overflow","2019-07 (Cologne)","|Complete|","15.0",""

@Zingam
Copy link
Contributor

Zingam commented Sep 8, 2024

Should I update the #100015 with subtasks what's implemented and what remains to be done?

@Zingam Zingam marked this pull request as draft September 8, 2024 12:45
@ldionne
Copy link
Member

ldionne commented Sep 9, 2024

Should I update the #100015 with subtasks what's implemented and what remains to be done?

That would be amazing!

@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/P1466R3-Mark-as-partially-implemented branch from dcee49d to f781ae2 Compare September 17, 2024 06:07
`hh_mm_ss` and related functions from https://wg21.link/P1466R3 was partially implemented in LLVM 10

Reference: llvm#100015
@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/P1466R3-Mark-as-partially-implemented branch from f781ae2 to d88301b Compare September 17, 2024 06:11
@Zingam Zingam marked this pull request as ready for review September 17, 2024 06:11
@Zingam Zingam changed the title [libc++][NFC] Mark P1424R1 as partially implemented with a note [libc++][NFC] Mark P1424R1 as partially implemented Sep 17, 2024
@Zingam
Copy link
Contributor

Zingam commented Sep 17, 2024

Should I update the #100015 with subtasks what's implemented and what remains to be done?

That would be amazing!

Thanks. I am working on it. I think it's enough for now to mark P1424R1 as partially implemented with this PR.

@ldionne ldionne merged commit 12b88f8 into llvm:main Sep 17, 2024
66 of 68 checks passed
hamphet pushed a commit to hamphet/llvm-project that referenced this pull request Sep 18, 2024
`hh_mm_ss` and related functions from https://wg21.link/P1466R3 were
partially implemented in LLVM 10 (fde236b).
tmsri pushed a commit to tmsri/llvm-project that referenced this pull request Sep 19, 2024
`hh_mm_ss` and related functions from https://wg21.link/P1466R3 were
partially implemented in LLVM 10 (fde236b).
@H-G-Hristov H-G-Hristov deleted the hgh/libcxx/P1466R3-Mark-as-partially-implemented branch October 8, 2024 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants