[libcxx-commits] [PATCH] D96200: [libc++] Remove C++11 work-arounds in src.
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Feb 9 09:31:11 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2544060e7180: [libc++] Remove C++11 work-arounds in src. (authored by Mordante).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96200/new/
https://reviews.llvm.org/D96200
Files:
libcxx/src/experimental/memory_resource.cpp
libcxx/src/filesystem/filesystem_common.h
Index: libcxx/src/filesystem/filesystem_common.h
===================================================================
--- libcxx/src/filesystem/filesystem_common.h
+++ libcxx/src/filesystem/filesystem_common.h
@@ -287,8 +287,7 @@
.count();
private:
-#if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
- static constexpr fs_duration get_min_nsecs() {
+ static _LIBCPP_CONSTEXPR_AFTER_CXX11 fs_duration get_min_nsecs() {
return duration_cast<fs_duration>(
fs_nanoseconds(min_nsec_timespec) -
duration_cast<fs_nanoseconds>(fs_seconds(1)));
@@ -298,7 +297,7 @@
FileTimeT::duration::min(),
"value doesn't roundtrip");
- static constexpr bool check_range() {
+ static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool check_range() {
// This kinda sucks, but it's what happens when we don't have __int128_t.
if (sizeof(TimeT) == sizeof(rep)) {
typedef duration<long long, ratio<3600 * 24 * 365> > Years;
@@ -309,7 +308,6 @@
min_seconds <= numeric_limits<TimeT>::min();
}
static_assert(check_range(), "the representable range is unacceptable small");
-#endif
};
template <class FileTimeT, class TimeT>
Index: libcxx/src/experimental/memory_resource.cpp
===================================================================
--- libcxx/src/experimental/memory_resource.cpp
+++ libcxx/src/experimental/memory_resource.cpp
@@ -76,12 +76,7 @@
~ResourceInitHelper() {}
};
-// When compiled in C++14 this initialization should be a constant expression.
-// Only in C++11 is "init_priority" needed to ensure initialization order.
-#if _LIBCPP_STD_VER > 11
-_LIBCPP_SAFE_STATIC
-#endif
-ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX;
+_LIBCPP_SAFE_STATIC ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX;
} // end namespace
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96200.322424.patch
Type: text/x-patch
Size: 1852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210209/ab00ec19/attachment-0001.bin>
More information about the libcxx-commits
mailing list