From ac0cc94982bb81e42fe56a82ae551a6ad8cd4670 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Fri, 8 Dec 2017 20:01:39 +0000
Subject: [PATCH 01/11] Config.MSVC-15.5: BOOST_NO_CXX11_SFINAE_EXPR no longer
required in C++14 or later mode.
---
include/boost/config/compiler/visualc.hpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp
index d23af835..49bb1a48 100644
--- a/include/boost/config/compiler/visualc.hpp
+++ b/include/boost/config/compiler/visualc.hpp
@@ -222,7 +222,9 @@
// C++ 11:
//
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#if (_MSC_VER < 1912) || (_MSVC_LANG < 201402)
#define BOOST_NO_CXX11_SFINAE_EXPR
+#endif
// C++ 14:
# define BOOST_NO_CXX14_CONSTEXPR
// C++ 17:
From 305f5a58ef879037b0fd9fdaa8e05615c1f4b7f1 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Sat, 9 Dec 2017 12:42:47 +0000
Subject: [PATCH 02/11] Config.msvc-15.5: Fix tests that can't pass in C++17.
---
test/boost_has_part_alloc.ipp | 6 +++--
test/boost_no_cxx11_hdr_type_traits.ipp | 5 ++++-
test/boost_no_cxx17_iterator_traits.ipp | 8 +++++--
test/boost_no_std_allocator.ipp | 29 ++++++++++++++++---------
4 files changed, 33 insertions(+), 15 deletions(-)
diff --git a/test/boost_has_part_alloc.ipp b/test/boost_has_part_alloc.ipp
index fb4bf516..3e4c2cb8 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 cf6cdd70..d4862a0c 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 ea75f232..5d0ee079 100644
--- a/test/boost_no_cxx17_iterator_traits.ipp
+++ b/test/boost_no_cxx17_iterator_traits.ipp
@@ -13,9 +13,13 @@
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 distance;
+ typedef char* pointer;
+ typedef char& reference;
};
struct non_iterator {};
diff --git a/test/boost_no_std_allocator.ipp b/test/boost_no_std_allocator.ipp
index d3badbd5..80e048e4 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;
- typedef typename alloc1_t::BOOST_NESTED_TEMPLATE rebind binder_t;
- typedef typename binder_t::other alloc2_t;
-
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;
+ (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;
}
From e376809717dc6e08eb572343f858b549e0623425 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Sat, 9 Dec 2017 12:44:38 +0000
Subject: [PATCH 03/11] Config.msvc-15.5: enable some initial C++17 features.
---
include/boost/config/compiler/visualc.hpp | 4 ++++
include/boost/config/stdlib/dinkumware.hpp | 7 ++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp
index 49bb1a48..40adff94 100644
--- a/include/boost/config/compiler/visualc.hpp
+++ b/include/boost/config/compiler/visualc.hpp
@@ -223,12 +223,16 @@
//
#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
+#endif
#define BOOST_NO_CXX17_FOLD_EXPRESSIONS
//
diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp
index 0fd97a41..641c2ae2 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)
From 280ebb91290195902182f05af26344aa76b17846 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Sat, 9 Dec 2017 17:45:26 +0000
Subject: [PATCH 04/11] Config.msvc-15.5: Fix test case for
BOOST_NO_CXX17_ITERATOR_TRAITS.
---
test/boost_no_cxx17_iterator_traits.ipp | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/test/boost_no_cxx17_iterator_traits.ipp b/test/boost_no_cxx17_iterator_traits.ipp
index 5d0ee079..cef88c05 100644
--- a/test/boost_no_cxx17_iterator_traits.ipp
+++ b/test/boost_no_cxx17_iterator_traits.ipp
@@ -17,9 +17,12 @@ struct iterator
{
typedef std::random_access_iterator_tag iterator_category;
typedef char value_type;
- typedef std::ptrdiff_t distance;
+ typedef std::ptrdiff_t difference_type;
typedef char* pointer;
typedef char& reference;
+
+ reference operator*()const;
+ iterator operator++();
};
struct non_iterator {};
@@ -41,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;
}
From 44e0d3ec75b8165658ad37f78e86aef89938b1b4 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Sat, 9 Dec 2017 18:02:33 +0000
Subject: [PATCH 05/11] Config.MSVC-14.5: complete configuration of new
compiler features.
---
include/boost/config/compiler/visualc.hpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp
index 40adff94..f6b7ffae 100644
--- a/include/boost/config/compiler/visualc.hpp
+++ b/include/boost/config/compiler/visualc.hpp
@@ -217,11 +217,16 @@
// 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
+#if (_MSC_VER < 1912)
+ // This is really only supported with /permissive- but as this is the default for new projects it seems
+ // sensible to allow this:
+# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#endif
#if (_MSC_VER < 1912) || (_MSVC_LANG < 201402)
// Supported from msvc-15.5 onwards:
#define BOOST_NO_CXX11_SFINAE_EXPR
@@ -232,8 +237,8 @@
// C++ 17:
#if (_MSC_VER < 1912) || (_MSVC_LANG < 201703)
#define BOOST_NO_CXX17_INLINE_VARIABLES
-#endif
#define BOOST_NO_CXX17_FOLD_EXPRESSIONS
+#endif
//
// Things that don't work in clr mode:
From 464f30fe36734b4c8be02767fbc8e1631742333c Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Sat, 9 Dec 2017 18:08:39 +0000
Subject: [PATCH 06/11] Config.MSVC-14.5: complete changes required, update
appveyor.yml to test /permissive-.
---
appveyor.yml | 2 +-
include/boost/config/compiler/visualc.hpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/appveyor.yml b/appveyor.yml
index 190d6fa9..c41150ee 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/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp
index f6b7ffae..8cbc20fb 100644
--- a/include/boost/config/compiler/visualc.hpp
+++ b/include/boost/config/compiler/visualc.hpp
@@ -338,7 +338,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)
From 1f86d5103085bb6c69f6c01296808a153c189f4b Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Mon, 11 Dec 2017 19:27:07 +0000
Subject: [PATCH 07/11] Config.MSVC-15.5: We still need to define
BOOST_NO_TWO_PHASE_NAME_LOOKUP as we can't tell if /permissive- is in effect
or not.
---
include/boost/config/compiler/visualc.hpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp
index 8cbc20fb..05a39df6 100644
--- a/include/boost/config/compiler/visualc.hpp
+++ b/include/boost/config/compiler/visualc.hpp
@@ -222,11 +222,12 @@
//
// C++ 11:
//
-#if (_MSC_VER < 1912)
- // This is really only supported with /permissive- but as this is the default for new projects it seems
- // sensible to allow this:
+// 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
-#endif
+
#if (_MSC_VER < 1912) || (_MSVC_LANG < 201402)
// Supported from msvc-15.5 onwards:
#define BOOST_NO_CXX11_SFINAE_EXPR
From f060bb1eca52d77cad5da30bb66c48f6bb0ba40b Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Mon, 11 Dec 2017 19:27:43 +0000
Subject: [PATCH 08/11] Config.MSVC-15.5: Update list of predefined macros
printed in config_info.cpp.
---
test/config_info.cpp | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/test/config_info.cpp b/test/config_info.cpp
index 89f6b07b..f9b16692 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_VOLATIL);
+ 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__);
From 90466c9d324fb325b423ec5d9544c54d188f7885 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Mon, 11 Dec 2017 19:31:31 +0000
Subject: [PATCH 09/11] Config.MSVC-15.5: Document changes to meaning of
BOOST_NO_STD_ITERATOR.
---
doc/macro_reference.qbk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk
index 94d0ca20..1f82b6fd 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
From baeb8cd5501db64c2b6c2714fc35d639abe44a4d Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Mon, 11 Dec 2017 19:32:29 +0000
Subject: [PATCH 10/11] Config.MSVC-15.5: Update docs.
---
doc/html/boost_config/boost_macro_reference.html | 15 ++++++++++++++-
doc/html/index.html | 2 +-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html
index 667484f9..b425d6eb 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 109e2013..397e2da3 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 |
|
From 884133ef7f4221a61f7c4069afc4b7b1910175df Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Mon, 11 Dec 2017 20:02:32 +0000
Subject: [PATCH 11/11] Config.MSVC-15.5: Fix macro spelling.
---
test/config_info.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/config_info.cpp b/test/config_info.cpp
index f9b16692..f30d1533 100644
--- a/test/config_info.cpp
+++ b/test/config_info.cpp
@@ -154,7 +154,7 @@ void print_compiler_macros()
PRINT_MACRO(_CPPRTTI);
PRINT_MACRO(_CPPUNWIND);
PRINT_MACRO(_DLL);
- PRINT_MACRO(_ISO_VOLATIL);
+ PRINT_MACRO(_ISO_VOLATILE);
PRINT_MACRO(_M_AMD64);
PRINT_MACRO(_M_ARM);
PRINT_MACRO(_M_ARM_ARMV7VE);