From 8b941c587636711080e1449b697b9dc53bdc86d2 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 22 Jun 2005 16:59:26 +0000 Subject: [PATCH] Added Tobias Schwinger's patch for gcc-3.2: ensures function types are correctly handled. [SVN r29737] --- .../type_traits/detail/cv_traits_impl.hpp | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits/detail/cv_traits_impl.hpp b/include/boost/type_traits/detail/cv_traits_impl.hpp index 9f59f29..eee7c7d 100644 --- a/include/boost/type_traits/detail/cv_traits_impl.hpp +++ b/include/boost/type_traits/detail/cv_traits_impl.hpp @@ -12,13 +12,22 @@ #define BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED #include "boost/config.hpp" +#include "boost/detail/workaround.hpp" #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +// implementation helper: + + +#if !(BOOST_WORKAROUND(__GNUC__,== 3) && (__GNUC_MINOR__ <= 2)) namespace boost { namespace detail { - -// implementation helper: +#else +#include "boost/type_traits/detail/yes_no_type.hpp" +namespace boost { +namespace type_traits { +namespace gcc8503 { +#endif template struct cv_traits_imp {}; @@ -54,6 +63,32 @@ 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 : ::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