diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2017-10-20 22:05:11 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2017-10-20 22:05:11 +0100 |
commit | 233fa165adf091bf19a56957560d0625bd373bae (patch) | |
tree | 5c7f02e61f654aeb0e7cdbb51d8153f80af437d1 | |
parent | af8630301d5bb5ae93d741ad4753f6a9d8817d89 (diff) | |
download | gcc-233fa165adf091bf19a56957560d0625bd373bae.zip gcc-233fa165adf091bf19a56957560d0625bd373bae.tar.gz gcc-233fa165adf091bf19a56957560d0625bd373bae.tar.bz2 |
Update value of __cpp_lib_chrono feature-test macro
* include/std/chrono (__cpp_lib_chrono): Update macro value to
indicate support for P0505R0.
* testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: Check
for updated macro.
From-SVN: r253959
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/std/chrono | 4 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/20_util/duration/arithmetic/constexpr_c++17.cc | 7 |
3 files changed, 14 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 179361d..7ec3f90 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2017-10-20 Jonathan Wakely <jwakely@redhat.com> + * include/std/chrono (__cpp_lib_chrono): Update macro value to + indicate support for P0505R0. + * testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: Check + for updated macro. + * include/c_global/cstddef: Define __cpp_lib_byte feature-test macro. * testsuite/18_support/byte/requirements.cc: Check macro. diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index fc058fc..9491508 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -214,8 +214,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION treat_as_floating_point<_Rep>::value; #endif // C++17 -#if __cplusplus > 201402L -# define __cpp_lib_chrono 201510 +#if __cplusplus >= 201703L +# define __cpp_lib_chrono 201611 template<typename _ToDur, typename _Rep, typename _Period> constexpr __enable_if_is_duration<_ToDur> diff --git a/libstdc++-v3/testsuite/20_util/duration/arithmetic/constexpr_c++17.cc b/libstdc++-v3/testsuite/20_util/duration/arithmetic/constexpr_c++17.cc index 438d50a..0ba1b8c 100644 --- a/libstdc++-v3/testsuite/20_util/duration/arithmetic/constexpr_c++17.cc +++ b/libstdc++-v3/testsuite/20_util/duration/arithmetic/constexpr_c++17.cc @@ -20,6 +20,13 @@ #include <chrono> #include <testsuite_common_types.h> + +#ifndef __cpp_lib_chrono +# error "Feature-test macro for constexpr <chrono> missing" +#elif __cpp_lib_chrono != 201611 +# error "Feature-test macro for constexpr <chrono> has wrong value" +#endif + constexpr auto test_operators() { std::chrono::nanoseconds d1 { 1 }; |