|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55234 - trunk/boost/spirit/home/support/detail
From: frabar666_at_[hidden]
Date: 2009-07-30 14:44:06
Author: fbarel
Date: 2009-07-28 13:07:49 EDT (Tue, 28 Jul 2009)
New Revision: 55234
URL: http://svn.boost.org/trac/boost/changeset/55234
Log:
Spirit: fix actions test failure on gcc-4.0.1
Text files modified:
trunk/boost/spirit/home/support/detail/make_cons.hpp | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
Modified: trunk/boost/spirit/home/support/detail/make_cons.hpp
==============================================================================
--- trunk/boost/spirit/home/support/detail/make_cons.hpp (original)
+++ trunk/boost/spirit/home/support/detail/make_cons.hpp 2009-07-28 13:07:49 EDT (Tue, 28 Jul 2009)
@@ -19,6 +19,7 @@
#include <boost/type_traits/is_abstract.hpp>
#include <boost/type_traits/is_function.hpp>
#include <boost/type_traits/add_reference.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace spirit { namespace detail
{
@@ -65,6 +66,20 @@
typedef typename fusion::cons<car_type> result;
return result(car);
}
+
+#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 0)
+ // workaround for gcc-4.0 bug where illegal function types
+ // can be formed (const is added to function type)
+ // description: http://lists.boost.org/Archives/boost/2009/04/150743.php
+ template <typename Car>
+ fusion::cons<typename as_meta_element<Car>::type>
+ make_cons(Car& car, typename enable_if<is_function<Car> >::type* = 0)
+ {
+ typedef typename as_meta_element<Car>::type car_type;
+ typedef typename fusion::cons<car_type> result;
+ return result(car);
+ }
+#endif
}}}
#endif
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