Merge pull request #198 from boostorg/msvc_15_5

Apply changes required by MSVC-15.5.
This commit is contained in:
jzmaddock
2017-12-12 10:00:24 +00:00
committed by GitHub
11 changed files with 106 additions and 26 deletions

View File

@ -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

View File

@ -939,7 +939,8 @@
<td>
<p>
The C++ implementation fails to provide the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">iterator</span></code>
class.
class. Note that post C++17, this macro is re-purposed to indicate
that std::iterator has been removed or deprecated.
</p>
</td>
</tr>
@ -3829,6 +3830,18 @@
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">BOOST_NO_CXX17_ITERATOR_TRAITS</span></code>
</p>
</td>
<td>
<p>
The compiler does not support SFINAE-friendly <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">iterator_traits</span></code>.
</p>
</td>
</tr>
</tbody>
</table></div>
</div>

View File

@ -992,7 +992,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: July 21, 2017 at 18:08:20 GMT</small></p></td>
<td align="left"><p><small>Last revised: December 11, 2017 at 19:32:07 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -28,6 +28,7 @@ template <class T>
int test_allocator(const T& i)
{
typedef std::allocator<int> 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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -28,20 +28,33 @@ template <class T>
int test_allocator(const T& i)
{
typedef std::allocator<int> 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<double> 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<double> 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;
}

View File

@ -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__);