-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
In the following code, parsing a do-statement with a condition (heavily simplified), the std::optional representing the condition should not be set. However, it is. This is a bug in boost.parser.
void reproducer()
{
namespace bp = boost::parser;
constexpr auto condition_clause =
bp::lit(U"while") > bp::lit(U"someexpression") >> bp::attr(true) ;
constexpr auto do_statement =
bp::lexeme[bp::lit(U"do") >> &bp::ws] > -condition_clause > bp::eol;
{
auto result = bp::parse(
U"do\n"
, do_statement, bp::blank, bp::trace::off);
BOOST_TEST(result);
std::optional<bool>& condition = result.value();
BOOST_TEST(!condition.has_value());
}
}Metadata
Metadata
Assignees
Labels
No labels