mirror of
https://github.com/boostorg/parser.git
synced 2026-01-30 20:12:23 +00:00
Fix an error in seq_parser when a non-attribute parser fails internally, after
the successful parse of an adjacent attribute-generating parser. Since the non-attribute parser points to the same spot in the output tuple, if the non-attribute parser fails internally, it is likely to do "out_attr = decltype(out_attr)()", which erases the previous seuccessfully generated attribute.
This commit is contained in:
@@ -2167,6 +2167,13 @@ TEST(parser, combined_seq_and_or)
|
||||
EXPECT_EQ(chars, "xyz");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
constexpr auto parser = int_ >> -(lit('a') | 'b');
|
||||
auto result = parse("34b", parser);
|
||||
EXPECT_TRUE(result);
|
||||
EXPECT_EQ(*result, 34);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(parser, eol_)
|
||||
|
||||
Reference in New Issue
Block a user