[libc++] Remove C++11 work-arounds in src.
Building libcxx requires at least C++17 so remove the old work-arounds.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D96200
GitOrigin-RevId: 2544060e718098c2cf736e2667ee007fbc58da50
diff --git a/src/experimental/memory_resource.cpp b/src/experimental/memory_resource.cpp
index 1304ef3..3319931 100644
--- a/src/experimental/memory_resource.cpp
+++ b/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
diff --git a/src/filesystem/filesystem_common.h b/src/filesystem/filesystem_common.h
index a450517..38d4eb0 100644
--- a/src/filesystem/filesystem_common.h
+++ b/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>