[Boost-bugs] [Boost C++ Libraries] #12932: Boost Spirit 1.63 "Char >> (Literal | Sequence)" Bug

Subject: [Boost-bugs] [Boost C++ Libraries] #12932: Boost Spirit 1.63 "Char >> (Literal | Sequence)" Bug
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-03-24 21:59:00


#12932: Boost Spirit 1.63 "Char >> (Literal | Sequence)" Bug
------------------------------+---------------------
 Reporter: jetdog330@… | Owner: djowel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: or sequence |
------------------------------+---------------------
 This is the simplest I was able to reduce this to. What is going on here?

 Requirements:
 -Boost 1.62 or 1.63 /w spirit v2
 -C++03/C++11/C++14

 Steps:
 g++ test.cpp && ./a.out

 Expected:
 Success: "x" "a" "b" "c"

 Result:
 Success: "x" "a" "" ""

 {{{
 #include <boost/spirit/include/qi.hpp>

 #include <cstdlib>
 #include <iostream>
 #include <string>

 int main(int argc, char * argv[]) {
     namespace qi = boost::spirit::qi;
     const std::string input("xabc");

     char x = 0;
     char a = 0;
     char b = 0;
     char c = 0;

     const int result = qi::parse(
         input.begin(),
         input.end(),
             qi::char_ >> (qi::lit("Z") | (qi::char_ >> qi::char_ >>
 qi::char_)),
             x, a, b, c
     );

     std::cout << (result ? "Success" : "Failure") << ": "
         << '"' << x << "\" \"" << a << "\" \"" << b << "\" \"" << c <<
 '"' << std::endl;
     return result ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12932>
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-03-24 22:03:51 UTC