From 3764d61f25862d5d85dc3ceee28e61db09970452 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 3 Apr 2018 19:08:57 +0100 Subject: [PATCH] BOOST_NO_CXX17_STD_INVOKE: Update test case to check we have std::invoke_result. MSVC has no std::invoke in C++14 mode. GCC has no std::invoke_result prior to 7.1. --- include/boost/config/stdlib/dinkumware.hpp | 2 +- include/boost/config/stdlib/libstdcpp3.hpp | 6 ++---- test/boost_no_cxx17_std_invoke.ipp | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index 641c2ae2..827bed4e 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -175,7 +175,7 @@ # define BOOST_NO_CXX17_STD_APPLY # define BOOST_NO_CXX17_ITERATOR_TRAITS #endif -#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) +#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0) # define BOOST_NO_CXX17_STD_INVOKE #endif diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index e99fe316..f6eab26c 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -294,12 +294,10 @@ extern "C" char *gets (char *__s); #endif // -// C++17 features in GCC 6.1 and later +// C++17 features in GCC 7.1 and later // -#if (BOOST_LIBSTDCXX_VERSION < 60100) || (__cplusplus <= 201402L) -# define BOOST_NO_CXX17_STD_INVOKE -#endif #if (BOOST_LIBSTDCXX_VERSION < 70100) || (__cplusplus <= 201402L) +# define BOOST_NO_CXX17_STD_INVOKE # define BOOST_NO_CXX17_STD_APPLY #endif diff --git a/test/boost_no_cxx17_std_invoke.ipp b/test/boost_no_cxx17_std_invoke.ipp index 77f20e6c..7de7e6ae 100644 --- a/test/boost_no_cxx17_std_invoke.ipp +++ b/test/boost_no_cxx17_std_invoke.ipp @@ -19,7 +19,7 @@ int foo( int i, int j) { int test() { int i = 1, j = 2; - std::invoke( foo, i, j); + typename std::invoke_result::type t = std::invoke( foo, i, j); return 0; }