From dea6757dbf4617257b88625c96cf55dfa36cab08 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 22 Mar 2019 19:25:33 +0000 Subject: [PATCH] Add support for noexcept detection via _NOEXCEPT_TYPES_SUPPORTED with msvc. See https://github.com/boostorg/type_traits/issues/118#issuecomment-475228526 --- include/boost/type_traits/detail/config.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/type_traits/detail/config.hpp b/include/boost/type_traits/detail/config.hpp index fe7596a..7c4b4f2 100644 --- a/include/boost/type_traits/detail/config.hpp +++ b/include/boost/type_traits/detail/config.hpp @@ -94,12 +94,19 @@ # define BOOST_TT_NO_NOEXCEPT_SEPARATE_TYPE #endif // -// If we have the SD6 macros (check for __cpp_rvalue_references succeeds), and we don't have __cpp_noexcept_function_type +// If we have the SD6 macros (check for C++11's __cpp_rvalue_references), and we don't have __cpp_noexcept_function_type // set, then don't treat noexcept functions as seperate types. This is a fix for msvc with the /Zc:noexceptTypes- flag set. // #if defined(__cpp_rvalue_references) && !defined(__cpp_noexcept_function_type) && !defined(BOOST_TT_NO_NOEXCEPT_SEPARATE_TYPE) # define BOOST_TT_NO_NOEXCEPT_SEPARATE_TYPE #endif +// +// Check MSVC specific macro on older msvc compilers that don't support the SD6 macros, we don't rely on this +// if the SD6 macros *are* available as it appears to be undocumented. +// +#if defined(BOOST_MSVC) && !defined(__cpp_rvalue_references) && !defined(BOOST_TT_NO_NOEXCEPT_SEPARATE_TYPE) && !defined(_NOEXCEPT_TYPES_SUPPORTED) +# define BOOST_TT_NO_NOEXCEPT_SEPARATE_TYPE +#endif #endif // BOOST_TT_CONFIG_HPP_INCLUDED