Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53158 - trunk/boost/proto
From: eric_at_[hidden]
Date: 2009-05-21 13:03:28


Author: eric_niebler
Date: 2009-05-21 13:03:28 EDT (Thu, 21 May 2009)
New Revision: 53158
URL: http://svn.boost.org/trac/boost/changeset/53158

Log:
workaround for gcc-3.4 bug, fixes #3021
Text files modified:
   trunk/boost/proto/proto_fwd.hpp | 17 ++++++++++++++++-
   trunk/boost/proto/traits.hpp | 8 ++++----
   2 files changed, 20 insertions(+), 5 deletions(-)

Modified: trunk/boost/proto/proto_fwd.hpp
==============================================================================
--- trunk/boost/proto/proto_fwd.hpp (original)
+++ trunk/boost/proto/proto_fwd.hpp 2009-05-21 13:03:28 EDT (Thu, 21 May 2009)
@@ -52,15 +52,30 @@
 # endif
 #endif
 
+#ifndef BOOST_PROTO_BROKEN_CONST_QUALIFIED_FUNCTIONS
+# if BOOST_WORKAROUND(__GNUC__, == 3)
+# define BOOST_PROTO_BROKEN_CONST_QUALIFIED_FUNCTIONS
+# endif
+#endif
+
 #ifdef BOOST_PROTO_BROKEN_CONST_OVERLOADS
 # include <boost/utility/enable_if.hpp>
 # include <boost/type_traits/is_const.hpp>
 # define BOOST_PROTO_DISABLE_IF_IS_CONST(T)\
- , typename boost::disable_if<boost::is_const<T>, boost::proto::detail::undefined>::type * = 0
+ , typename boost::disable_if_c<boost::is_const<T>::value, boost::proto::detail::undefined>::type * = 0
 #else
 # define BOOST_PROTO_DISABLE_IF_IS_CONST(T)
 #endif
 
+#ifdef BOOST_PROTO_BROKEN_CONST_QUALIFIED_FUNCTIONS
+# include <boost/utility/enable_if.hpp>
+# include <boost/type_traits/is_function.hpp>
+# define BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T)\
+ , typename boost::disable_if_c<boost::is_function<T>::value, boost::proto::detail::undefined>::type * = 0
+#else
+# define BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T)
+#endif
+
 #ifndef BOOST_PROTO_BROKEN_PTS
 # if BOOST_WORKAROUND(BOOST_MSVC, <= 1400)
 # define BOOST_PROTO_BROKEN_PTS

Modified: trunk/boost/proto/traits.hpp
==============================================================================
--- trunk/boost/proto/traits.hpp (original)
+++ trunk/boost/proto/traits.hpp 2009-05-21 13:03:28 EDT (Thu, 21 May 2009)
@@ -1975,7 +1975,7 @@
         /// \param t The object to wrap.
         template<typename T>
         typename result_of::as_expr<T>::reference
- as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T))
+ as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
         {
             return result_of::as_expr<T>::call(t);
         }
@@ -1993,7 +1993,7 @@
         ///
         template<typename Domain, typename T>
         typename result_of::as_expr<T, Domain>::reference
- as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T))
+ as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
         {
             return result_of::as_expr<T, Domain>::call(t);
         }
@@ -2028,7 +2028,7 @@
         /// \param t The object to wrap.
         template<typename T>
         typename result_of::as_child<T>::type
- as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T))
+ as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
         {
             return result_of::as_child<T>::call(t);
         }
@@ -2046,7 +2046,7 @@
         ///
         template<typename Domain, typename T>
         typename result_of::as_child<T, Domain>::type
- as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T))
+ as_child(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T) BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T))
         {
             return result_of::as_child<T, Domain>::call(t);
         }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk