From 7713e90dc31f47e10ed39615ff2bc7d67f45dacf Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 30 Sep 2013 16:01:57 +0000 Subject: [PATCH] TypeTraits: Remove obsolete GCC version checks. [SVN r86077] --- include/boost/type_traits/common_type.hpp | 2 +- include/boost/type_traits/config.hpp | 1 - .../type_traits/detail/cv_traits_impl.hpp | 33 ------------------- .../detail/has_binary_operator.hpp | 2 +- .../detail/has_postfix_operator.hpp | 2 +- .../detail/has_prefix_operator.hpp | 2 +- include/boost/type_traits/is_const.hpp | 7 ---- .../boost/type_traits/is_lvalue_reference.hpp | 14 -------- 8 files changed, 4 insertions(+), 59 deletions(-) diff --git a/include/boost/type_traits/common_type.hpp b/include/boost/type_traits/common_type.hpp index f057770..b52ff16 100644 --- a/include/boost/type_traits/common_type.hpp +++ b/include/boost/type_traits/common_type.hpp @@ -120,7 +120,7 @@ namespace type_traits_detail { typedef BOOST_TYPEOF_TPL(declval_b() ? declval_T() : declval_U()) type; #endif -#if defined(__GNUC__) && __GNUC__ == 3 && (__GNUC_MINOR__ == 2 || __GNUC_MINOR__ == 3) +#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 3 public: void public_dummy_function_just_to_silence_warning(); #endif diff --git a/include/boost/type_traits/config.hpp b/include/boost/type_traits/config.hpp index 9e818b4..f3775e3 100644 --- a/include/boost/type_traits/config.hpp +++ b/include/boost/type_traits/config.hpp @@ -27,7 +27,6 @@ #endif # if (BOOST_WORKAROUND(__MWERKS__, < 0x3000) \ - || !defined(__EDG_VERSION__) && BOOST_WORKAROUND(__GNUC__, < 3) \ || BOOST_WORKAROUND(__IBMCPP__, < 600 ) \ || BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) \ || defined(__ghs) \ diff --git a/include/boost/type_traits/detail/cv_traits_impl.hpp b/include/boost/type_traits/detail/cv_traits_impl.hpp index ed20c9d..15064d2 100644 --- a/include/boost/type_traits/detail/cv_traits_impl.hpp +++ b/include/boost/type_traits/detail/cv_traits_impl.hpp @@ -19,15 +19,8 @@ // implementation helper: -#if !(BOOST_WORKAROUND(__GNUC__,== 3) && BOOST_WORKAROUND(__GNUC_MINOR__, <= 2)) namespace boost { namespace detail { -#else -#include -namespace boost { -namespace type_traits { -namespace gcc8503 { -#endif template struct cv_traits_imp {}; @@ -63,32 +56,6 @@ struct cv_traits_imp typedef T unqualified_type; }; -#if BOOST_WORKAROUND(__GNUC__,== 3) && BOOST_WORKAROUND(__GNUC_MINOR__, <= 2) -// We have to exclude function pointers -// (see http://gcc.gnu.org/bugzilla/show_bug.cgi?8503) -yes_type mini_funcptr_tester(...); -no_type mini_funcptr_tester(const volatile void*); - -} // namespace gcc8503 -} // namespace type_traits - -namespace detail { - -// Use the implementation above for non function pointers -template -struct cv_traits_imp : public ::boost::type_traits::gcc8503::cv_traits_imp { }; - -// Functions are never cv-qualified -template struct cv_traits_imp -{ - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type; -}; - -#endif - } // namespace detail } // namespace boost diff --git a/include/boost/type_traits/detail/has_binary_operator.hpp b/include/boost/type_traits/detail/has_binary_operator.hpp index 1fd26ef..9f91843 100644 --- a/include/boost/type_traits/detail/has_binary_operator.hpp +++ b/include/boost/type_traits/detail/has_binary_operator.hpp @@ -36,7 +36,7 @@ // warning C4804: '<' : unsafe use of type 'bool' in operation // warning C4805: '==' : unsafe mix of type 'bool' and type 'char' in operation // cannot find another implementation -> declared as system header to suppress these warnings. -#if defined(__GNUC__) && ((__GNUC__==3 && __GNUC_MINOR__>=1) || (__GNUC__>3)) +#if defined(__GNUC__) # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) diff --git a/include/boost/type_traits/detail/has_postfix_operator.hpp b/include/boost/type_traits/detail/has_postfix_operator.hpp index 5c52b07..52b8f81 100644 --- a/include/boost/type_traits/detail/has_postfix_operator.hpp +++ b/include/boost/type_traits/detail/has_postfix_operator.hpp @@ -22,7 +22,7 @@ #include // avoid warnings -#if defined(__GNUC__) && ((__GNUC__==3 && __GNUC_MINOR__>=1) || (__GNUC__>3)) +#if defined(__GNUC__) # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) diff --git a/include/boost/type_traits/detail/has_prefix_operator.hpp b/include/boost/type_traits/detail/has_prefix_operator.hpp index ac30e4d..9c4ccd5 100644 --- a/include/boost/type_traits/detail/has_prefix_operator.hpp +++ b/include/boost/type_traits/detail/has_prefix_operator.hpp @@ -30,7 +30,7 @@ // warning C4146: unary minus operator applied to unsigned type, result still unsigned // warning C4804: '-' : unsafe use of type 'bool' in operation // cannot find another implementation -> declared as system header to suppress these warnings. -#if defined(__GNUC__) && ((__GNUC__==3 && __GNUC_MINOR__>=1) || (__GNUC__>3)) +#if defined(__GNUC__) # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) diff --git a/include/boost/type_traits/is_const.hpp b/include/boost/type_traits/is_const.hpp index 0c7da4a..e429cb4 100644 --- a/include/boost/type_traits/is_const.hpp +++ b/include/boost/type_traits/is_const.hpp @@ -87,13 +87,6 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& volatile,false) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& const volatile,false) #endif -#if defined(__GNUC__) && (__GNUC__ < 3) -// special case for gcc where illegally cv-qualified reference types can be -// generated in some corner cases: -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T const,!(::boost::is_reference::value)) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T volatile const,!(::boost::is_reference::value)) -#endif - #else namespace detail { diff --git a/include/boost/type_traits/is_lvalue_reference.hpp b/include/boost/type_traits/is_lvalue_reference.hpp index a6af859..228da11 100644 --- a/include/boost/type_traits/is_lvalue_reference.hpp +++ b/include/boost/type_traits/is_lvalue_reference.hpp @@ -50,20 +50,6 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& volati BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const volatile,true) #endif -#if defined(__GNUC__) && (__GNUC__ < 3) -// these allow us to work around illegally cv-qualified reference -// types. -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T const ,::boost::is_lvalue_reference::value) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T volatile ,::boost::is_lvalue_reference::value) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T const volatile ,::boost::is_lvalue_reference::value) -// However, the above specializations confuse gcc 2.96 unless we also -// supply these specializations for array types -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,T[N],false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,const T[N],false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,volatile T[N],false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,const volatile T[N],false) -#endif - #else #ifdef BOOST_MSVC