id summary reporter owner description type status milestone component version severity resolution keywords cc 5566 Spirit.Lex converting a token to its value in a lexer semantic action fails Reko Tiira Hartmut Kaiser "Discussed this on #boost with heller and he said to post a bug report about the issue. Here's a test case that should apparently work fine: {{{ #include #include #include #include #include namespace lex = boost::spirit::lex; template struct text_decorator_lexer : lex::lexer { text_decorator_lexer() : tag_open(""\\{\\{.+?\\}\\}"") , tag_close(""\\{\\{\\/.+?\\}\\}"") , var(""\\$\\$.+?\\$\\$"") , any(""."") { using boost::spirit::lex::_val; using boost::phoenix::push_back; using boost::phoenix::ref; this->self = tag_open [push_back(ref(tokens), _val)] | tag_close [push_back(ref(tokens), _val)] | var [push_back(ref(tokens), _val)] | any [push_back(ref(tokens), _val)] ; } std::vector tokens; lex::token_def tag_open, tag_close, var, any; }; int main() { typedef lex::lexertl::token, boost::mpl::false_> token_type; typedef lex::lexertl::actor_lexer lexer_type; text_decorator_lexer text_decorator_tokenizer; std::string input = ""Hello {{b}}there{{/b}}, the time is $$time$$.""; char const* first = input.c_str(); char const* last = &first[input.size()]; lex::tokenize(first, last, text_decorator_tokenizer); } }}} And the relevant part of the error is: {{{ /opt/local/include/boost/spirit/home/phoenix/stl/container/container.hpp:492:40: error: no matching function for call to 'std::vector >::push_back(const boost::variant, boost::mpl::v_item, boost::mpl::vector0, 1>, 1> >, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>&)' /opt/local/include/boost/spirit/home/phoenix/stl/container/container.hpp:492:40: note: candidate is: /opt/local/include/gcc46/c++/bits/stl_vector.h:826:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::basic_string, _Alloc = std::allocator >, std::vector<_Tp, _Alloc>::value_type = std::basic_string] /opt/local/include/gcc46/c++/bits/stl_vector.h:826:7: note: no known conversion for argument 1 from 'const boost::variant, boost::mpl::v_item, boost::mpl::vector0, 1>, 1> >, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>' to 'const value_type&' /opt/local/include/boost/spirit/home/phoenix/stl/container/container.hpp:492:40: error: return-statement with a value, in function returning 'void' [-fpermissive] }}} Tested with: gcc version 4.6.1 20110325 (prerelease) (GCC) gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)" Bugs closed To Be Determined spirit Boost 1.46.1 Problem fixed