diff --git a/libcxx/src/chrono.cpp b/libcxx/src/chrono.cpp --- a/libcxx/src/chrono.cpp +++ b/libcxx/src/chrono.cpp @@ -99,7 +99,7 @@ nanoseconds::period>>; // The Windows epoch is Jan 1 1601, the Unix epoch Jan 1 1970. - static _LIBCPP_CONSTEXPR const seconds nt_to_unix_epoch{11644473600}; + static constexpr const seconds nt_to_unix_epoch{11644473600}; FILETIME ft; #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8 && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) || \ diff --git a/libcxx/src/condition_variable.cpp b/libcxx/src/condition_variable.cpp --- a/libcxx/src/condition_variable.cpp +++ b/libcxx/src/condition_variable.cpp @@ -61,7 +61,7 @@ __libcpp_timespec_t ts; seconds s = duration_cast(d); typedef decltype(ts.tv_sec) ts_sec; - _LIBCPP_CONSTEXPR ts_sec ts_sec_max = numeric_limits::max(); + constexpr ts_sec ts_sec_max = numeric_limits::max(); if (s.count() < ts_sec_max) { ts.tv_sec = static_cast(s.count()); diff --git a/libcxx/src/experimental/memory_resource.cpp b/libcxx/src/experimental/memory_resource.cpp --- a/libcxx/src/experimental/memory_resource.cpp +++ b/libcxx/src/experimental/memory_resource.cpp @@ -74,7 +74,7 @@ __null_memory_resource_imp null_res; } resources; char dummy; - _LIBCPP_CONSTEXPR_SINCE_CXX14 ResourceInitHelper() : resources() {} + constexpr ResourceInitHelper() : resources() {} ~ResourceInitHelper() {} }; diff --git a/libcxx/src/filesystem/error.h b/libcxx/src/filesystem/error.h --- a/libcxx/src/filesystem/error.h +++ b/libcxx/src/filesystem/error.h @@ -112,7 +112,7 @@ template T error_value(); template <> -inline _LIBCPP_CONSTEXPR_SINCE_CXX14 void error_value() {} +inline constexpr void error_value() {} template <> inline bool error_value() { return false; @@ -128,7 +128,7 @@ return uintmax_t(-1); } template <> -inline _LIBCPP_CONSTEXPR_SINCE_CXX14 file_time_type error_value() { +inline constexpr file_time_type error_value() { return file_time_type::min(); } template <> diff --git a/libcxx/src/filesystem/time_utils.h b/libcxx/src/filesystem/time_utils.h --- a/libcxx/src/filesystem/time_utils.h +++ b/libcxx/src/filesystem/time_utils.h @@ -147,7 +147,7 @@ .count(); private: - static _LIBCPP_CONSTEXPR fs_duration get_min_nsecs() { + static constexpr fs_duration get_min_nsecs() { return duration_cast( fs_nanoseconds(min_nsec_timespec) - duration_cast(fs_seconds(1))); @@ -157,7 +157,7 @@ FileTimeT::duration::min(), "value doesn't roundtrip"); - static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool check_range() { + static constexpr 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 > Years; @@ -225,7 +225,7 @@ public: template - static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool checked_set(CType* out, + static constexpr bool checked_set(CType* out, ChronoType time) { using Lim = numeric_limits; if (time > Lim::max() || time < Lim::min()) @@ -234,7 +234,7 @@ return true; } - static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool is_representable(TimeSpecT tm) { + static constexpr bool is_representable(TimeSpecT tm) { if (tm.tv_sec >= 0) { return tm.tv_sec < max_seconds || (tm.tv_sec == max_seconds && tm.tv_nsec <= max_nsec); @@ -245,7 +245,7 @@ } } - static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool is_representable(FileTimeT tm) { + static constexpr bool is_representable(FileTimeT tm) { auto secs = duration_cast(tm.time_since_epoch()); auto nsecs = duration_cast(tm.time_since_epoch() - secs); if (nsecs.count() < 0) { @@ -258,7 +258,7 @@ return secs.count() >= TLim::min(); } - static _LIBCPP_CONSTEXPR_SINCE_CXX14 FileTimeT + static constexpr FileTimeT convert_from_timespec(TimeSpecT tm) { if (tm.tv_sec >= 0 || tm.tv_nsec == 0) { return FileTimeT(fs_seconds(tm.tv_sec) + @@ -272,7 +272,7 @@ } template - static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool + static constexpr bool set_times_checked(TimeT* sec_out, SubSecT* subsec_out, FileTimeT tp) { auto dur = tp.time_since_epoch(); auto sec_dur = duration_cast(dur); @@ -289,7 +289,7 @@ return checked_set(sec_out, sec_dur.count()) && checked_set(subsec_out, subsec_dur.count()); } - static _LIBCPP_CONSTEXPR_SINCE_CXX14 bool convert_to_timespec(TimeSpecT& dest, + static constexpr bool convert_to_timespec(TimeSpecT& dest, FileTimeT tp) { if (!is_representable(tp)) return false; diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -94,7 +94,7 @@ template inline -_LIBCPP_CONSTEXPR +constexpr size_t countof(const T (&)[N]) { @@ -103,7 +103,7 @@ template inline -_LIBCPP_CONSTEXPR +constexpr size_t countof(const T * const begin, const T * const end) { @@ -1097,7 +1097,7 @@ const ctype::mask* ctype::classic_table() noexcept { - static _LIBCPP_CONSTEXPR const ctype::mask builtin_table[table_size] = { + static constexpr const ctype::mask builtin_table[table_size] = { cntrl, cntrl, cntrl, cntrl, cntrl, cntrl, diff --git a/libcxx/src/memory.cpp b/libcxx/src/memory.cpp --- a/libcxx/src/memory.cpp +++ b/libcxx/src/memory.cpp @@ -149,7 +149,7 @@ _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER }; -_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) noexcept +constexpr __sp_mut::__sp_mut(void* p) noexcept : __lx_(p) { } diff --git a/libcxx/src/memory_resource.cpp b/libcxx/src/memory_resource.cpp --- a/libcxx/src/memory_resource.cpp +++ b/libcxx/src/memory_resource.cpp @@ -74,7 +74,7 @@ __null_memory_resource_imp null_res; } resources; char dummy; - _LIBCPP_CONSTEXPR_SINCE_CXX14 ResourceInitHelper() : resources() {} + constexpr ResourceInitHelper() : resources() {} ~ResourceInitHelper() {} }; diff --git a/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp --- a/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp +++ b/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 +// UNSUPPORTED: c++03, c++11 // UNSUPPORTED: availability-filesystem-missing // UNSUPPORTED: no-filesystem // ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../../../src