diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2018-10-15 17:33:20 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2018-10-15 17:33:20 +0000 |
| commit | 323e01d46fad7a66c3f44c7ab41b319ad3c454bc (patch) | |
| tree | 9e861168037f2466612d38565ac632cce99917b8 /libcxx/include | |
| parent | 8bd74785f0a29510805fa38a3e4f4bd8b6bceefd (diff) | |
| download | bcm5719-llvm-323e01d46fad7a66c3f44c7ab41b319ad3c454bc.tar.gz bcm5719-llvm-323e01d46fad7a66c3f44c7ab41b319ad3c454bc.zip | |
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
llvm-svn: 344535
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/__config | 5 | ||||
| -rw-r--r-- | libcxx/include/chrono | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index 14ecb8fb426..7e47f44790c 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -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))) diff --git a/libcxx/include/chrono b/libcxx/include/chrono index 1812df8f495..75258abd26b 100644 --- a/libcxx/include/chrono +++ b/libcxx/include/chrono @@ -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)); |

