From 72f0ebe8d06991968c6f792c0a846519a795cac1 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 24 May 2020 00:29:51 +0300 Subject: [PATCH] Adjusted the check for C++20 on gcc 10. The compiler defines __cplusplus to a non-standard value less than 202002 in C++20 mode. --- test/iterator_traits_test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/iterator_traits_test.cpp b/test/iterator_traits_test.cpp index 467373a..7abf56a 100644 --- a/test/iterator_traits_test.cpp +++ b/test/iterator_traits_test.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -153,7 +154,8 @@ input_iterator_test, int, std::ptrdiff_t, int*, int&, istream_iterator_test; // C++20 changed ostream_iterator::difference_type to ptrdiff_t. -#if __cplusplus >= 202002L && (\ +// Note: gcc 10.1 defines __cplusplus to a value less than 202002L, but greater than 201703L in C++20 mode. +#if __cplusplus > 201703L && (\ (defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION >= 100100) \ ) #define BOOST_ITERATOR_CXX20_OSTREAM_ITERATOR