[libcxx-commits] [PATCH] D133490: [libc++] Fix compilation error on platforms that don't implement std::tm
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 8 08:56:43 PDT 2022
Mordante added a comment.
Which platforms don't have `tm` that we support? Can we add a CI for them?
================
Comment at: libcxx/include/__chrono/convert_to_tm.h:31
# endif
-
- if constexpr (same_as<_Tp, chrono::day>)
- __result.tm_mday = static_cast<unsigned>(__value);
- else
- static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
-
+ __result.tm_mday = static_cast<unsigned>(__value);
return __result;
----------------
Why is this change? As mentioned during our review it looks a bit odd now. However this function will get support for all chrono types that are formattable. An example of the "final" version can be seen in the function `__make_tm`
in https://reviews.llvm.org/D126592#change-qGrpldbZrZTa .
================
Comment at: libcxx/test/std/time/time.syn/formatter.day.pass.cpp:9
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: libcpp-has-no-localization
+// UNSUPPORTED: no-localization
// UNSUPPORTED: libcpp-has-no-incomplete-format
----------------
Thanks! Nice catch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133490/new/
https://reviews.llvm.org/D133490
More information about the libcxx-commits
mailing list