Opened 11 years ago

Closed 11 years ago

#5701 closed Bugs (fixed)

lexertl token_value_type returns const unused for nonconst ref

Reported by: Peter Schueller <schueller.p@…> Owned by: Hartmut Kaiser
Milestone: To Be Determined Component: spirit
Version: Boost Release Branch Severity: Problem
Keywords: Cc:

Description

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.

Change History (2)

comment:1 by Joel de Guzman, 11 years ago

Owner: changed from Joel de Guzman to Hartmut Kaiser

comment:2 by Hartmut Kaiser, 11 years ago

Resolution: fixed
Status: newclosed

(In [73122]) Spirit: fixed #5701: lexertl token_value_type returns const unused for nonconst ref

Note: See TracTickets for help on using tickets.