Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2008-05-27 03:27:20


Author: eric_niebler
Date: 2008-05-27 03:27:19 EDT (Tue, 27 May 2008)
New Revision: 45810
URL: http://svn.boost.org/trac/boost/changeset/45810

Log:
get statement tests passing on gcc
Text files modified:
   branches/proto/v4/boost/phoenix/core/reference.hpp | 14 ++++++++++++--
   branches/proto/v4/boost/phoenix/core/value.hpp | 16 ++++++++++++++--
   branches/proto/v4/boost/phoenix/scope/let.hpp | 3 +--
   branches/proto/v4/boost/phoenix/statement/switch.hpp | 2 +-
   4 files changed, 28 insertions(+), 7 deletions(-)

Modified: branches/proto/v4/boost/phoenix/core/reference.hpp
==============================================================================
--- branches/proto/v4/boost/phoenix/core/reference.hpp (original)
+++ branches/proto/v4/boost/phoenix/core/reference.hpp 2008-05-27 03:27:19 EDT (Tue, 27 May 2008)
@@ -18,12 +18,22 @@
       : proto::terminal<T &>::type
     {
         explicit reference(T &t)
- : proto::terminal<T &>::type(proto::terminal<T &>::type::make(t))
+ : proto::terminal<T &>::type(
+ proto::terminal<T &>::type::make(t)
+ )
+ {}
+
+ reference(reference<T> const volatile &that)
+ : proto::terminal<T &>::type(
+ proto::terminal<T &>::type::make(that.child0)
+ )
         {}
 
         operator actor<reference<T> >() const
         {
- actor<reference<T> > that = {*this};
+ // work around strange infinite recursion issue on gcc
+ reference<T> const volatile &vthis = *this;
+ actor<reference<T> > that = {vthis};
             return that;
         }
     };

Modified: branches/proto/v4/boost/phoenix/core/value.hpp
==============================================================================
--- branches/proto/v4/boost/phoenix/core/value.hpp (original)
+++ branches/proto/v4/boost/phoenix/core/value.hpp 2008-05-27 03:27:19 EDT (Tue, 27 May 2008)
@@ -27,12 +27,24 @@
       : proto::terminal<T>::type
     {
         explicit value(T const &t)
- : proto::terminal<T>::type(proto::terminal<T>::type::make(t))
+ : proto::terminal<T>::type(
+ proto::terminal<T>::type::make(t)
+ )
+ {}
+
+ value(value<T> const volatile &that)
+ : proto::terminal<T>::type(
+ proto::terminal<T>::type::make(
+ const_cast<T const &>(that.child0)
+ )
+ )
         {}
 
         operator actor<value<T> >() const
         {
- actor<value<T> > that = {*this};
+ // work around strange infinite recursion issue on gcc
+ value<T> const volatile &vthis = *this;
+ actor<value<T> > that = {vthis};
             return that;
         }
     };

Modified: branches/proto/v4/boost/phoenix/scope/let.hpp
==============================================================================
--- branches/proto/v4/boost/phoenix/scope/let.hpp (original)
+++ branches/proto/v4/boost/phoenix/scope/let.hpp 2008-05-27 03:27:19 EDT (Tue, 27 May 2008)
@@ -151,6 +151,7 @@
                 };
             };
 
+ ////////////////////////////////////////////////////////////////////////////////////////
             template<typename SubGrammar>
             struct with_grammar
             {
@@ -253,8 +254,6 @@
         {};
 
         ////////////////////////////////////////////////////////////////////////////////////////////
- // BUGBUG this isn't quite right. It gets the answer wrong for
- // let(_a = 1)[ _a += arg1 ]
         template<typename SubGrammar>
         struct is_nullary_extension<tag::let_, SubGrammar>
           : detail::with_grammar<SubGrammar>::is_nullary_extension

Modified: branches/proto/v4/boost/phoenix/statement/switch.hpp
==============================================================================
--- branches/proto/v4/boost/phoenix/statement/switch.hpp (original)
+++ branches/proto/v4/boost/phoenix/statement/switch.hpp 2008-05-27 03:27:19 EDT (Tue, 27 May 2008)
@@ -202,7 +202,7 @@
 
 #else
 
- #define N BOOST_PP_ITERATION()
+ #define N BOOST_PP_SUB(PHOENIX_LIMIT, BOOST_PP_ITERATION())
 
         #define M0(Z, N, DATA) \
             proto::expr<tag::case_<BOOST_PP_CAT(L, N)>, BOOST_PP_CAT(A, N), 1> const &BOOST_PP_CAT(a, N)\


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