diff --git a/appveyor.yml b/appveyor.yml index 190d6fa9b..c41150ee5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,7 +21,7 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 ARGS: --toolset=msvc-14.1 address-model=32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest + ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest cxxflags=-permissive- - ARGS: --toolset=msvc-9.0 address-model=32 - ARGS: --toolset=msvc-10.0 address-model=32 - ARGS: --toolset=msvc-11.0 address-model=32 diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index 667484f9b..b425d6ebb 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -939,7 +939,8 @@

The C++ implementation fails to provide the std::iterator - class. + class. Note that post C++17, this macro is re-purposed to indicate + that std::iterator has been removed or deprecated.

@@ -3829,6 +3830,18 @@

+ + +

+ BOOST_NO_CXX17_ITERATOR_TRAITS +

+ + +

+ The compiler does not support SFINAE-friendly std::iterator_traits. +

+ + diff --git a/doc/html/index.html b/doc/html/index.html index 109e20134..397e2da35 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -992,7 +992,7 @@ - +

Last revised: July 21, 2017 at 18:08:20 GMT

Last revised: December 11, 2017 at 19:32:07 GMT


diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index 94d0ca201..1f82b6fd3 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -232,7 +232,8 @@ The C++ standard library does not provide a standards conforming The platform does not have a conforming version of `std::distance`. ]] [[`BOOST_NO_STD_ITERATOR`][Standard library][ -The C++ implementation fails to provide the `std::iterator` class. +The C++ implementation fails to provide the `std::iterator` class. +Note that post C++17, this macro is re-purposed to indicate that std::iterator has been removed or deprecated. ]] [[`BOOST_NO_STD_ITERATOR_TRAITS`][Standard library][ The compiler does not provide a standard compliant implementation of diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index d23af8351..05a39df62 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -217,17 +217,29 @@ // https://connect.microsoft.com/VisualStudio/feedback/details/1582233/c-subobjects-still-not-value-initialized-correctly // See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues // (Niels Dekker, LKEB, May 2010) +// Still present in VC15.5, Dec 2017. #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION // // C++ 11: // -#define BOOST_NO_TWO_PHASE_NAME_LOOKUP +// This is supported with /permissive- for 15.5 onwards, unfortunately we appear to have no way to tell +// if this is in effect or not, in any case nothing in Boost is currently using this, so we'll just go +// on defining it for now: +// +# define BOOST_NO_TWO_PHASE_NAME_LOOKUP + +#if (_MSC_VER < 1912) || (_MSVC_LANG < 201402) +// Supported from msvc-15.5 onwards: #define BOOST_NO_CXX11_SFINAE_EXPR +#endif // C++ 14: +// Still gives internal compiler error for msvc-15.5: # define BOOST_NO_CXX14_CONSTEXPR // C++ 17: +#if (_MSC_VER < 1912) || (_MSVC_LANG < 201703) #define BOOST_NO_CXX17_INLINE_VARIABLES #define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif // // Things that don't work in clr mode: @@ -327,7 +339,7 @@ // // last known and checked version is 19.11.25506 (VC++ 2017.3): -#if (_MSC_VER > 1911) +#if (_MSC_VER > 1912) # if defined(BOOST_ASSERT_CONFIG) # error "Boost.Config is older than your current compiler version." # elif !defined(BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE) diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index 0fd97a41f..641c2ae2e 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -173,10 +173,15 @@ // C++17 features #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1910) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0) # define BOOST_NO_CXX17_STD_APPLY +# define BOOST_NO_CXX17_ITERATOR_TRAITS #endif #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) # define BOOST_NO_CXX17_STD_INVOKE -# define BOOST_NO_CXX17_ITERATOR_TRAITS +#endif + +#if !(!defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1912) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0)) +// Deprecated std::iterator: +# define BOOST_NO_STD_ITERATOR #endif #if defined(BOOST_INTEL) && (BOOST_INTEL <= 1400) diff --git a/test/boost_has_part_alloc.ipp b/test/boost_has_part_alloc.ipp index fb4bf5162..3e4c2cb88 100644 --- a/test/boost_has_part_alloc.ipp +++ b/test/boost_has_part_alloc.ipp @@ -28,6 +28,7 @@ template int test_allocator(const T& i) { typedef std::allocator alloc1_t; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) typedef typename alloc1_t::size_type size_type; typedef typename alloc1_t::difference_type difference_type BOOST_UNUSED_ATTRIBUTE; typedef typename alloc1_t::pointer pointer; @@ -35,9 +36,10 @@ int test_allocator(const T& i) typedef typename alloc1_t::reference reference; typedef typename alloc1_t::const_reference const_reference; typedef typename alloc1_t::value_type value_type BOOST_UNUSED_ATTRIBUTE; - +#endif alloc1_t a1; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) pointer p = a1.allocate(1); const_pointer cp = p; a1.construct(p,i); @@ -49,7 +51,7 @@ int test_allocator(const T& i) if(cp != a1.address(cr)) return -1; a1.destroy(p); a1.deallocate(p,1); - +#endif return 0; } diff --git a/test/boost_no_cxx11_hdr_type_traits.ipp b/test/boost_no_cxx11_hdr_type_traits.ipp index cf6cdd70e..d4862a0c8 100644 --- a/test/boost_no_cxx11_hdr_type_traits.ipp +++ b/test/boost_no_cxx11_hdr_type_traits.ipp @@ -45,7 +45,11 @@ int test() using std::is_trivially_copyable; using std::is_standard_layout; using std::is_pod; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) + // deprecated in C++ 17: using std::is_literal_type; + using std::result_of; +#endif using std::is_empty; using std::is_polymorphic; using std::is_abstract; @@ -99,7 +103,6 @@ int test() using std::conditional; using std::common_type; using std::underlying_type; - using std::result_of; return 0; } diff --git a/test/boost_no_cxx17_iterator_traits.ipp b/test/boost_no_cxx17_iterator_traits.ipp index ea75f2323..cef88c058 100644 --- a/test/boost_no_cxx17_iterator_traits.ipp +++ b/test/boost_no_cxx17_iterator_traits.ipp @@ -13,9 +13,16 @@ namespace boost_no_cxx17_iterator_traits { -struct iterator : - public std::iterator< std::random_access_iterator_tag, char > +struct iterator { + typedef std::random_access_iterator_tag iterator_category; + typedef char value_type; + typedef std::ptrdiff_t difference_type; + typedef char* pointer; + typedef char& reference; + + reference operator*()const; + iterator operator++(); }; struct non_iterator {}; @@ -37,11 +44,9 @@ struct has_iterator_category< Traits, typename void_type< typename Traits::itera int test() { - if (!has_iterator_category< std::iterator_traits< boost_no_cxx17_iterator_traits::iterator > >::value) - return 1; + static_assert(has_iterator_category< std::iterator_traits< boost_no_cxx17_iterator_traits::iterator > >::value, "has_iterator_category failed"); - if (has_iterator_category< std::iterator_traits< boost_no_cxx17_iterator_traits::non_iterator > >::value) - return 2; + static_assert(!has_iterator_category< std::iterator_traits< boost_no_cxx17_iterator_traits::non_iterator > >::value, "has_iterator_category negative check failed"); return 0; } diff --git a/test/boost_no_std_allocator.ipp b/test/boost_no_std_allocator.ipp index d3badbd5d..80e048e48 100644 --- a/test/boost_no_std_allocator.ipp +++ b/test/boost_no_std_allocator.ipp @@ -28,20 +28,33 @@ template int test_allocator(const T& i) { typedef std::allocator alloc1_t; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) + // stuff deprecated in C++17: typedef typename alloc1_t::size_type size_type; typedef typename alloc1_t::difference_type difference_type BOOST_UNUSED_ATTRIBUTE; typedef typename alloc1_t::pointer pointer; typedef typename alloc1_t::const_pointer const_pointer; typedef typename alloc1_t::reference reference; typedef typename alloc1_t::const_reference const_reference; + #endif typedef typename alloc1_t::value_type value_type BOOST_UNUSED_ATTRIBUTE; + alloc1_t a1; + alloc1_t a2(a1); +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) + // stuff deprecated in C++17: typedef typename alloc1_t::BOOST_NESTED_TEMPLATE rebind binder_t; typedef typename binder_t::other alloc2_t; + alloc2_t a3(a1); + // this chokes early versions of the MSL library + // and isn't currently required by anything in boost + // so don't test for now... + // a3 = a2; - alloc1_t a1; - alloc1_t a2(a1); + (void)a2; +#endif +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) pointer p = a1.allocate(1); const_pointer cp = p; a1.construct(p,i); @@ -52,15 +65,11 @@ int test_allocator(const T& i) if(p != a1.address(r)) return -1; if(cp != a1.address(cr)) return -1; a1.destroy(p); +#else + auto p = a1.allocate(1); +#endif a1.deallocate(p,1); - alloc2_t a3(a1); - // this chokes early versions of the MSL library - // and isn't currently required by anything in boost - // so don't test for now... - // a3 = a2; - - (void)a2; return 0; } diff --git a/test/config_info.cpp b/test/config_info.cpp index 89f6b07b4..f30d15331 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -143,19 +143,49 @@ void print_compiler_macros() PRINT_MACRO(_WCHAR_T_DEFINED); #endif // MSVC macros: + PRINT_MACRO(__ATOM__); + PRINT_MACRO(__AVX__); + PRINT_MACRO(__AVX2__); + PRINT_MACRO(_CHAR_UNSIGNED); + PRINT_MACRO(_CLR_VER); + PRINT_MACRO(_CONTROL_FLOW_GUARD); + PRINT_MACRO(__cplusplus_cli); + PRINT_MACRO(__cplusplus_winrt); PRINT_MACRO(_CPPRTTI); + PRINT_MACRO(_CPPUNWIND); PRINT_MACRO(_DLL); + PRINT_MACRO(_ISO_VOLATILE); + PRINT_MACRO(_M_AMD64); + PRINT_MACRO(_M_ARM); + PRINT_MACRO(_M_ARM_ARMV7VE); + PRINT_MACRO(_M_ARM_FP); + PRINT_MACRO(_M_ARM64); + PRINT_MACRO(_M_CEE); + PRINT_MACRO(_M_CEE_PURE); + PRINT_MACRO(_M_CEE_SAFE); + PRINT_MACRO(_M_FP_EXCEPT); + PRINT_MACRO(_M_FP_FAST); + PRINT_MACRO(_M_FP_PRECISE); + PRINT_MACRO(_M_FP_STRICT); + PRINT_MACRO(_M_IX86); + PRINT_MACRO(_M_IX86_FP); + PRINT_MACRO(_M_X64); PRINT_MACRO(_M_ALPHA); PRINT_MACRO(_M_MPPC); PRINT_MACRO(_M_MRX000); PRINT_MACRO(_M_PPC); + PRINT_MACRO(_MANAGED); + PRINT_MACRO(_MSC_BUILD); PRINT_MACRO(_MFC_VER); PRINT_MACRO(_MSC_EXTENSIONS); PRINT_MACRO(_MSC_VER); PRINT_MACRO(_MSC_FULL_VER); PRINT_MACRO(_MSVC_LANG); + PRINT_MACRO(__MSVC_RUNTIME_CHECKS); PRINT_MACRO(_MT); PRINT_MACRO(_NATIVE_WCHAR_T_DEFINED); + PRINT_MACRO(_OPENMP); + PRINT_MACRO(_PREFAST_); // GNUC options: PRINT_MACRO(__GNUC__); PRINT_MACRO(__GNUC_MINOR__);