Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73122 - trunk/boost/spirit/home/lex/lexer/lexertl
From: hartmut.kaiser_at_[hidden]
Date: 2011-07-15 13:53:15


Author: hkaiser
Date: 2011-07-15 13:53:15 EDT (Fri, 15 Jul 2011)
New Revision: 73122
URL: http://svn.boost.org/trac/boost/changeset/73122

Log:
Spirit: fixed #5701: lexertl token_value_type returns const unused for nonconst ref
Text files modified:
   trunk/boost/spirit/home/lex/lexer/lexertl/position_token.hpp | 2 +-
   trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp | 2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/position_token.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/position_token.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/position_token.hpp 2011-07-15 13:53:15 EDT (Fri, 15 Jul 2011)
@@ -173,7 +173,7 @@
         iterpair_type& matched() { return matched_; }
         iterpair_type const& matched() const { return matched_; }
 
- token_value_type& value() { return unused; }
+ token_value_type& value() { static token_value_type u; return u; }
         token_value_type const& value() const { return unused; }
 
 #if BOOST_WORKAROUND(BOOST_MSVC, == 1600)

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp 2011-07-15 13:53:15 EDT (Fri, 15 Jul 2011)
@@ -140,7 +140,7 @@
         token(id_type id, std::size_t, token_value_type)
           : id_(id) {}
 
- token_value_type& value() { return unused; }
+ token_value_type& value() { static token_value_type u; return u; }
         token_value_type const& value() const { return unused; }
 
 #if defined(BOOST_SPIRIT_DEBUG)


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