mirror of
https://github.com/boostorg/core.git
synced 2025-05-11 05:07:39 +00:00
Disable use of std::launder under msvc-14.1. Fixes #160.
This commit is contained in:
parent
8af04d101c
commit
e4adc769aa
@ -11,14 +11,28 @@
|
|||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
#if defined(__has_builtin)
|
#if defined(__has_builtin)
|
||||||
# if __has_builtin(__builtin_launder)
|
# if __has_builtin(__builtin_launder)
|
||||||
# define BOOST_CORE_HAS_BUILTIN_LAUNDER
|
# define BOOST_CORE_HAS_BUILTIN_LAUNDER
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)) && !defined(BOOST_CORE_HAS_BUILTIN_LAUNDER)
|
#if defined(BOOST_MSVC) && BOOST_MSVC < 1920
|
||||||
# include <new>
|
|
||||||
|
// msvc-14.1 suffers from internal compiler errors when using std::launder
|
||||||
|
// https://github.com/boostorg/core/issues/160
|
||||||
|
// https://github.com/boostorg/optional/issues/122
|
||||||
|
|
||||||
|
#elif (BOOST_CXX_VERSION >= 201703L) && !defined(BOOST_CORE_HAS_BUILTIN_LAUNDER)
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
|
||||||
|
#if defined(__cpp_lib_launder)
|
||||||
|
# define BOOST_CORE_HAS_STD_LAUNDER
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
@ -33,7 +47,7 @@ template<class T> T* launder( T* p )
|
|||||||
return __builtin_launder( p );
|
return __builtin_launder( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)) && defined(__cpp_lib_launder)
|
#elif defined(BOOST_CORE_HAS_STD_LAUNDER)
|
||||||
|
|
||||||
template<class T> T* launder( T* p )
|
template<class T> T* launder( T* p )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user