[Boost-bugs] [Boost C++ Libraries] #5701: lexertl token_value_type returns const unused for nonconst ref

Subject: [Boost-bugs] [Boost C++ Libraries] #5701: lexertl token_value_type returns const unused for nonconst ref
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-07-15 14:00:18


#5701: lexertl token_value_type returns const unused for nonconst ref
-----------------------------------------------------+----------------------
 Reporter: Peter Schueller <schueller.p@…> | Owner: djowel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
  Version: Boost Release Branch | Severity: Problem
 Keywords: |
-----------------------------------------------------+----------------------
 Compiling the following source file creates an error with clang (trunk
 version):

 {{{
 #include <boost/spirit/include/lex_lexertl.hpp>
 }}}

 The error (I think clang is right not to accept this code) is:

 {{{
 In file included from bug_unused_const.cpp:1:
 In file included from /var/lib/buildbot/instdirs/boost-
 trunk/include/boost/spirit/include/lex_lexertl.hpp:16:
 In file included from /var/lib/buildbot/instdirs/boost-
 trunk/include/boost/spirit/home/lex/lexer_lexertl.hpp:16:
 In file included from /var/lib/buildbot/instdirs/boost-
 trunk/include/boost/spirit/home/lex/lexer/lexertl/lexer.hpp:20:
 /var/lib/buildbot/instdirs/boost-
 trunk/include/boost/spirit/home/lex/lexer/lexertl/token.hpp:143:44: error:
 binding of reference to type 'token_value_type' (aka
 'boost::spirit::unused_type'
 ) to a value of type 'const boost::spirit::unused_type' drops qualifiers
         token_value_type& value() { return unused; }
                                            ^~~~~~
 }}}

 The token_value_type return value is a nonconst unused_type, whereas
 unused is a const object of unused_type.

 This is true both in trunk and release branch.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5701>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC