[libcxx-commits] [PATCH] D113027: [libcxx] Remove nonstandard _FilesystemClock::{to, from}_time_t

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 15 06:46:57 PST 2021


mstorsjo added a comment.

In D113027#3131369 <https://reviews.llvm.org/D113027#3131369>, @alexfh wrote:

> In D113027#3125511 <https://reviews.llvm.org/D113027#3125511>, @mstorsjo wrote:
>
>> In D113027#3115431 <https://reviews.llvm.org/D113027#3115431>, @bgraur wrote:
>>
>>> This revision removes the only available methods to convert std::chrono::file_time_type to/from anything else.
>>>
>>> The standard says std::chrono::file_time_type::clock should have methods: to_sys() and from_sys() to convert to/from std::chrono::system_time.
>>>
>>> Is it possible to revert this change until the standard methods are implemented?
>>
>> https://reviews.llvm.org/D113430 landed now, which should have implemented the standard methods instead.
>
> That doesn't help, since the standard methods are only available since C++20, while the ones removed here were available for earlier standards. There is code out there, which already relies on these non-standard functions and it's going to be broken by this change without a reasonable alternative (migrating the code to C++20 is not a real alternative). While I understand the desire to strictly follow the standard, it's also not nice to break existing code that relied on these features without a transition period. Can we have this reverted to give folks time to migrate code? To prevent backslide, these non-standard API fragments could be placed under an #ifdef and accompanied by a compiler warning.

That sounds reasonable to me, but @ldionne has the final say on the matter.

How do you handle this with other C++ libraries, do they provide `to_sys`/`from_sys` even before C++20, or do they use some other nonstandard method, or were you only using this setup on libc++?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113027/new/

https://reviews.llvm.org/D113027



More information about the libcxx-commits mailing list