is_virtual_base_of: more workarounds for clang and older gcc versions

This commit is contained in:
John Maddock
2018-05-10 11:34:02 +01:00
parent 02270ed668
commit fbc50bfd12
2 changed files with 4 additions and 3 deletions

View File

@ -12,6 +12,7 @@
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/make_void.hpp>
#include <utility>
namespace boost {
namespace detail {
@ -24,7 +25,7 @@ namespace boost {
#pragma GCC system_header
#endif
#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && !defined(BOOST_NO_CXX11_NULLPTR) && !BOOST_WORKAROUND(BOOST_GCC, <= 40800)
#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && !defined(BOOST_NO_CXX11_NULLPTR) && !BOOST_WORKAROUND(BOOST_GCC, < 40800)
#ifdef __clang__
@ -32,7 +33,7 @@ namespace boost {
constexpr bool is_virtual_base_impl(...) { return true; }
template<class T, class U,
boost::void_t<decltype(static_cast<U*>(std::declval<T*>()))>* =
boost::void_t<decltype((U*)(std::declval<T*>()))>* =
nullptr>
constexpr bool is_virtual_base_impl(int) { return false; }

View File

@ -132,7 +132,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<non_virtual_base,non_vir
//
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<bug11309_A, bug11309_C>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<bug11309_A, bug11309_B>::value), true);
#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && !defined(BOOST_NO_CXX11_NULLPTR)
#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && !defined(BOOST_NO_CXX11_NULLPTR) && !BOOST_WORKAROUND(BOOST_GCC, < 40800)
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<bug11323_B, bug11323_C>::value), false);
#ifndef BOOST_NO_CXX11_FINAL
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<bug11323_2B, bug11323_2C>::value), false);