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:
Marshall Clow
2018-10-15 17:33:20 +00:00
parent fc25eebcac
commit 1b8e200470
4 changed files with 10 additions and 1 deletions

View File

@@ -492,6 +492,11 @@ namespace std {
#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)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))

View File

@@ -2668,7 +2668,7 @@ inline namespace literals
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
{
return chrono::day(static_cast<unsigned>(__d));

View File

@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// 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>
// class day;

View File

@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// 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>
// class year;