Wrap up the new chrono literals in an #ifdef so that old versions of clang don't complain. I'm looking at you, clang 5.0.1
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344535 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -492,6 +492,11 @@ namespace std {
|
|||||||
|
|
||||||
#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
|
#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
|
||||||
|
|
||||||
|
// No apple compilers support ""d and ""y at this time.
|
||||||
|
#if _LIBCPP_CLANG_VER < 800 || defined(__apple_build_version__)
|
||||||
|
#define _LIBCPP_HAS_NO_CXX20_CHRONO_LITERALS
|
||||||
|
#endif
|
||||||
|
|
||||||
#elif defined(_LIBCPP_COMPILER_GCC)
|
#elif defined(_LIBCPP_COMPILER_GCC)
|
||||||
|
|
||||||
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
|
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
|
||||||
|
|||||||
@@ -2668,7 +2668,7 @@ inline namespace literals
|
|||||||
return chrono::duration<long double, nano> (__ns);
|
return chrono::duration<long double, nano> (__ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _LIBCPP_STD_VER > 17
|
#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_CHRONO_LITERALS)
|
||||||
constexpr chrono::day operator ""d(unsigned long long __d) noexcept
|
constexpr chrono::day operator ""d(unsigned long long __d) noexcept
|
||||||
{
|
{
|
||||||
return chrono::day(static_cast<unsigned>(__d));
|
return chrono::day(static_cast<unsigned>(__d));
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||||
|
// UNSUPPORTED: clang-5, clang-6
|
||||||
|
// UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8, apple-clang-9
|
||||||
|
|
||||||
// <chrono>
|
// <chrono>
|
||||||
// class day;
|
// class day;
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||||
|
// UNSUPPORTED: clang-5, clang-6
|
||||||
|
// UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8, apple-clang-9
|
||||||
|
|
||||||
// <chrono>
|
// <chrono>
|
||||||
// class year;
|
// class year;
|
||||||
|
|||||||
Reference in New Issue
Block a user