diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk
index 94d0ca20..a3335447 100644
--- a/doc/macro_reference.qbk
+++ b/doc/macro_reference.qbk
@@ -1095,8 +1095,11 @@ In either case this macro has no effect on runtime behavior and performance
of code.
]]
[[`BOOST_EXPLICIT_TEMPLATE_TYPE(t)`
+
`BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t,v)`
+
`BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t)`
+
`BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t,v)`][
Some compilers silently "fold" different function template instantiations if
some of the template parameters don't appear in the function parameter list.
@@ -1247,6 +1250,7 @@ If the compiler does not support this markup, `BOOST_NORETURN` is defined empty
additional macro `BOOST_NO_NORETURN` is defined.
]]
[[`BOOST_LIKELY(X)`
+
`BOOST_UNLIKELY(X)`][
These macros communicate to the compiler that the conditional expression `X` is likely
or unlikely to yield a positive result. The expression should result in a boolean value.
@@ -1275,6 +1279,8 @@ Usage example:
typedef unsigned int BOOST_MAY_ALIAS aliasing_uint;
``
]]
+[[`BOOST_PRAGMA_MESSAGE(M)`][Expands to the equivalent of `#pragma message(M)`. `M` must
+be a string literal. Example: `BOOST_PRAGMA_MESSAGE("This header is deprecated.")`.]]
]
[endsect]
diff --git a/include/boost/config/pragma_message.hpp b/include/boost/config/pragma_message.hpp
new file mode 100644
index 00000000..a6292fd0
--- /dev/null
+++ b/include/boost/config/pragma_message.hpp
@@ -0,0 +1,24 @@
+#ifndef BOOST_CONFIG_PRAGMA_MESSAGE_HPP_INCLUDED
+#define BOOST_CONFIG_PRAGMA_MESSAGE_HPP_INCLUDED
+
+// Copyright 2017 Peter Dimov.
+//
+// Distributed under the Boost Software License, Version 1.0.
+//
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+// BOOST_PRAGMA_MESSAGE("message")
+
+#if defined(__GNUC__)
+#define BOOST_PRAGMA_MESSAGE_IMPL_1(x) _Pragma(#x)
+#define BOOST_PRAGMA_MESSAGE(x) BOOST_PRAGMA_MESSAGE_IMPL_1(message(x))
+#elif defined(_MSC_VER)
+#define BOOST_PRAGMA_MESSAGE_IMPL_2(x, f, ln) __pragma(message(f "(" #ln "): note: " x))
+#define BOOST_PRAGMA_MESSAGE_IMPL_1(x, f, ln) BOOST_PRAGMA_MESSAGE_IMPL_2(x, f, ln)
+#define BOOST_PRAGMA_MESSAGE(x) BOOST_PRAGMA_MESSAGE_IMPL_1(x, __FILE__, __LINE__)
+#else
+#define BOOST_PRAGMA_MESSAGE(x)
+#endif
+
+#endif // BOOST_CONFIG_PRAGMA_MESSAGE_HPP_INCLUDED
diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
index 09422bfc..16147352 100644
--- a/test/Jamfile.v2
+++ b/test/Jamfile.v2
@@ -103,6 +103,7 @@ test-suite config
[ run cstdint_test2.cpp : : : all gcc:"-Wno-long-long -Wextra" darwin:-Wno-long-long ]
[ compile cstdint_include_test.cpp : all gcc:-Wextra ]
[ run config_build_check.cpp : : : [ requires int128 cxx11_constexpr cxx11_user_defined_literals ] ]
+ [ compile pragma_message_test.cpp ]
;
obj has_clang_implicit_fallthrough : cmd_line_check.cpp :
diff --git a/test/pragma_message_test.cpp b/test/pragma_message_test.cpp
new file mode 100644
index 00000000..9464897c
--- /dev/null
+++ b/test/pragma_message_test.cpp
@@ -0,0 +1,18 @@
+// Copyright 2017 Peter Dimov.
+//
+// Distributed under the Boost Software License, Version 1.0.
+//
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include
+
+BOOST_PRAGMA_MESSAGE("first message")
+
+#define MSG2 "second message"
+BOOST_PRAGMA_MESSAGE(MSG2)
+
+#include // BOOST_STRINGIZE
+
+#define MSG3 third message
+BOOST_PRAGMA_MESSAGE(BOOST_STRINGIZE(MSG3))
From 77c6a915db37fea17816be665534984c7338e98a Mon Sep 17 00:00:00 2001
From: Peter Dimov
Date: Mon, 4 Dec 2017 01:24:39 +0200
Subject: [PATCH 12/30] Document BOOST_PRAGMA_MESSAGE header; fix mentions of
detail/workaround.hpp
---
doc/html/boost_config/boost_macro_reference.html | 7 ++++---
doc/html/index.html | 2 +-
doc/macro_reference.qbk | 9 +++++----
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html
index b1266a09..ffa9fd1d 100644
--- a/doc/html/boost_config/boost_macro_reference.html
+++ b/doc/html/boost_config/boost_macro_reference.html
@@ -3968,7 +3968,7 @@
that is not otherwise described by one of the other Boost.Config
macros. To use the macro you must first
- Expands to the equivalent of #pragma
+ Defined in header <boost/config/pragma_message.hpp>,
+ this macro expands to the equivalent of #pragmamessage(M).
M must be a string
literal. Example: BOOST_PRAGMA_MESSAGE("This header
diff --git a/doc/html/index.html b/doc/html/index.html
index 12c33f3d..d75d10cc 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -992,7 +992,7 @@
-
Last revised: December 03, 2017 at 22:51:50 GMT
+
Last revised: December 03, 2017 at 23:12:48 GMT
diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk
index a3335447..3d4a1ce7 100644
--- a/doc/macro_reference.qbk
+++ b/doc/macro_reference.qbk
@@ -979,7 +979,7 @@ workarounds for compiler/standard library defects.
This macro is used where a compiler specific workaround is required that is not otherwise
described by one of the other Boost.Config macros. To use the macro you must first
``
-#include
+#include
``
usage is then:
``
@@ -1001,7 +1001,7 @@ For example
of `__BORLANDC__` /unless/ the macro `BOOST_DETECT_OUTDATED_WORKAROUNDS` is defined, in which case evaluates to
`(__BORLANDC__ <= 0x590)`.
-[*Note]: the ultimate source of documentation for this macro is in [@../../../../boost/detail/workaround.hpp boost/detail/workaround.hpp].
+[*Note]: the ultimate source of documentation for this macro is in [@../../../../boost/config/workaround.hpp boost/config/workaround.hpp].
]]
[[`BOOST_PREVENT_MACRO_SUBSTITUTION`][
Sometimes you have a function name with the same name as a C macro, for example "min" and "max"
@@ -1279,8 +1279,9 @@ Usage example:
typedef unsigned int BOOST_MAY_ALIAS aliasing_uint;
``
]]
-[[`BOOST_PRAGMA_MESSAGE(M)`][Expands to the equivalent of `#pragma message(M)`. `M` must
-be a string literal. Example: `BOOST_PRAGMA_MESSAGE("This header is deprecated.")`.]]
+[[`BOOST_PRAGMA_MESSAGE(M)`][Defined in header ``,
+this macro expands to the equivalent of `#pragma message(M)`. `M` must be a string
+literal. Example: `BOOST_PRAGMA_MESSAGE("This header is deprecated.")`.]]
]
[endsect]
From 08bd1dbe71f1067c43804455f207a74f1c34740a Mon Sep 17 00:00:00 2001
From: Peter Dimov
Date: Mon, 4 Dec 2017 18:05:05 +0200
Subject: [PATCH 13/30] Move BOOST_STRINGIZE, BOOST_JOIN to
config/helper_macros.hpp; use BOOST_STRINGIZE in BOOST_PRAGMA_MESSAGE
---
include/boost/config/detail/suffix.hpp | 19 ++-----------
include/boost/config/helper_macros.hpp | 37 +++++++++++++++++++++++++
include/boost/config/pragma_message.hpp | 13 +++++----
test/Jamfile.v2 | 1 +
test/helper_macros_test.cpp | 30 ++++++++++++++++++++
5 files changed, 78 insertions(+), 22 deletions(-)
create mode 100644 include/boost/config/helper_macros.hpp
create mode 100644 test/helper_macros_test.cpp
diff --git a/include/boost/config/detail/suffix.hpp b/include/boost/config/detail/suffix.hpp
index caa0b229..4aeac4c7 100644
--- a/include/boost/config/detail/suffix.hpp
+++ b/include/boost/config/detail/suffix.hpp
@@ -537,25 +537,10 @@ namespace std{ using ::type_info; }
// ---------------------------------------------------------------------------//
-//
// Helper macro BOOST_STRINGIZE:
-// Converts the parameter X to a string after macro replacement
-// on X has been performed.
-//
-#define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
-#define BOOST_DO_STRINGIZE(X) #X
-
-//
// Helper macro BOOST_JOIN:
-// The following piece of macro magic joins the two
-// arguments together, even when one of the arguments is
-// itself a macro (see 16.3.1 in C++ standard). The key
-// is that macro expansion of macro arguments does not
-// occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
-//
-#define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
-#define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
-#define BOOST_DO_JOIN2( X, Y ) X##Y
+
+#include
//
// Set some default values for compiler/library/platform names.
diff --git a/include/boost/config/helper_macros.hpp b/include/boost/config/helper_macros.hpp
new file mode 100644
index 00000000..3e79526d
--- /dev/null
+++ b/include/boost/config/helper_macros.hpp
@@ -0,0 +1,37 @@
+#ifndef BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED
+#define BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED
+
+// Copyright 2001 John Maddock.
+// Copyright 2017 Peter Dimov.
+//
+// Distributed under the Boost Software License, Version 1.0.
+//
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+// BOOST_STRINGIZE(X)
+// BOOST_JOIN(X, Y)
+//
+// Note that this header is C compatible.
+
+//
+// Helper macro BOOST_STRINGIZE:
+// Converts the parameter X to a string after macro replacement
+// on X has been performed.
+//
+#define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
+#define BOOST_DO_STRINGIZE(X) #X
+
+//
+// Helper macro BOOST_JOIN:
+// The following piece of macro magic joins the two
+// arguments together, even when one of the arguments is
+// itself a macro (see 16.3.1 in C++ standard). The key
+// is that macro expansion of macro arguments does not
+// occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
+//
+#define BOOST_JOIN(X, Y) BOOST_DO_JOIN(X, Y)
+#define BOOST_DO_JOIN(X, Y) BOOST_DO_JOIN2(X,Y)
+#define BOOST_DO_JOIN2(X, Y) X##Y
+
+#endif // BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED
diff --git a/include/boost/config/pragma_message.hpp b/include/boost/config/pragma_message.hpp
index a6292fd0..448ccc0f 100644
--- a/include/boost/config/pragma_message.hpp
+++ b/include/boost/config/pragma_message.hpp
@@ -9,14 +9,17 @@
// http://www.boost.org/LICENSE_1_0.txt
//
// BOOST_PRAGMA_MESSAGE("message")
+//
+// Expands to the equivalent of #pragma message("message")
+//
+// Note that this header is C compatible.
+
+#include
#if defined(__GNUC__)
-#define BOOST_PRAGMA_MESSAGE_IMPL_1(x) _Pragma(#x)
-#define BOOST_PRAGMA_MESSAGE(x) BOOST_PRAGMA_MESSAGE_IMPL_1(message(x))
+#define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x)))
#elif defined(_MSC_VER)
-#define BOOST_PRAGMA_MESSAGE_IMPL_2(x, f, ln) __pragma(message(f "(" #ln "): note: " x))
-#define BOOST_PRAGMA_MESSAGE_IMPL_1(x, f, ln) BOOST_PRAGMA_MESSAGE_IMPL_2(x, f, ln)
-#define BOOST_PRAGMA_MESSAGE(x) BOOST_PRAGMA_MESSAGE_IMPL_1(x, __FILE__, __LINE__)
+#define BOOST_PRAGMA_MESSAGE(x) __pragma(message(__FILE__ "(" BOOST_STRINGIZE(__LINE__) "): note: " x))
#else
#define BOOST_PRAGMA_MESSAGE(x)
#endif
diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
index 16147352..9f1e4ea4 100644
--- a/test/Jamfile.v2
+++ b/test/Jamfile.v2
@@ -103,6 +103,7 @@ test-suite config
[ run cstdint_test2.cpp : : : all gcc:"-Wno-long-long -Wextra" darwin:-Wno-long-long ]
[ compile cstdint_include_test.cpp : all gcc:-Wextra ]
[ run config_build_check.cpp : : : [ requires int128 cxx11_constexpr cxx11_user_defined_literals ] ]
+ [ run helper_macros_test.cpp ]
[ compile pragma_message_test.cpp ]
;
diff --git a/test/helper_macros_test.cpp b/test/helper_macros_test.cpp
new file mode 100644
index 00000000..5bbea8dd
--- /dev/null
+++ b/test/helper_macros_test.cpp
@@ -0,0 +1,30 @@
+// Copyright 2017 Peter Dimov.
+//
+// Distributed under the Boost Software License, Version 1.0.
+//
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include
+#include
+
+int main()
+{
+#define X pumpkin
+
+ BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(X), "pumpkin" );
+ BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(__LINE__), "16" );
+
+#define Y 2
+
+ int BOOST_JOIN(X, Y) = 0;
+ (void)pumpkin2;
+
+ int BOOST_JOIN(X, __LINE__) = 0;
+ (void)pumpkin23;
+
+ BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(BOOST_JOIN(X, Y)), "pumpkin2" );
+ BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(BOOST_JOIN(X, __LINE__)), "pumpkin27" );
+
+ return boost::report_errors();
+}
From 23327d6d0169c73ace8f7b91a40f03f4de4839fa Mon Sep 17 00:00:00 2001
From: Peter Dimov
Date: Mon, 4 Dec 2017 19:15:36 +0200
Subject: [PATCH 14/30] Suppress BOOST_PRAGMA_MESSAGE messages when
BOOST_DISABLE_PRAGMA_MESSAGE is defined
---
include/boost/config/pragma_message.hpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/boost/config/pragma_message.hpp b/include/boost/config/pragma_message.hpp
index 448ccc0f..d213f63c 100644
--- a/include/boost/config/pragma_message.hpp
+++ b/include/boost/config/pragma_message.hpp
@@ -16,12 +16,14 @@
#include
-#if defined(__GNUC__)
-#define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x)))
+#if defined(BOOST_DISABLE_PRAGMA_MESSAGE)
+# define BOOST_PRAGMA_MESSAGE(x)
+#elif defined(__GNUC__)
+# define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x)))
#elif defined(_MSC_VER)
-#define BOOST_PRAGMA_MESSAGE(x) __pragma(message(__FILE__ "(" BOOST_STRINGIZE(__LINE__) "): note: " x))
+# define BOOST_PRAGMA_MESSAGE(x) __pragma(message(__FILE__ "(" BOOST_STRINGIZE(__LINE__) "): note: " x))
#else
-#define BOOST_PRAGMA_MESSAGE(x)
+# define BOOST_PRAGMA_MESSAGE(x)
#endif
#endif // BOOST_CONFIG_PRAGMA_MESSAGE_HPP_INCLUDED
From ac0cc94982bb81e42fe56a82ae551a6ad8cd4670 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Fri, 8 Dec 2017 20:01:39 +0000
Subject: [PATCH 15/30] 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 16/30] 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 17/30] 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 18/30] 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 19/30] 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 20/30] 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 21/30] 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 22/30] 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 23/30] 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 24/30] 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.
+