@@ -11694,7 +11694,7 @@ Parser<ManagedTokenSource>::parse_stmt_or_expr_without_block ()
11694
11694
{
11695
11695
// should be expr without block
11696
11696
std::unique_ptr<AST::ExprWithoutBlock> expr
11697
- = parse_expr_without_block ();
11697
+ = parse_expr_without_block (std::move (outer_attrs) );
11698
11698
11699
11699
if (lexer.peek_token ()->get_id () == SEMICOLON)
11700
11700
{
@@ -11739,7 +11739,7 @@ Parser<ManagedTokenSource>::parse_stmt_or_expr_without_block ()
11739
11739
// FIXME: old code was good until composability was required
11740
11740
// return parse_path_based_stmt_or_expr(std::move(outer_attrs));
11741
11741
std::unique_ptr<AST::ExprWithoutBlock> expr
11742
- = parse_expr_without_block ();
11742
+ = parse_expr_without_block (std::move (outer_attrs) );
11743
11743
11744
11744
if (lexer.peek_token ()->get_id () == SEMICOLON)
11745
11745
{
@@ -11762,7 +11762,7 @@ Parser<ManagedTokenSource>::parse_stmt_or_expr_without_block ()
11762
11762
* expression then make it statement if semi afterwards */
11763
11763
11764
11764
std::unique_ptr<AST::ExprWithoutBlock> expr
11765
- = parse_expr_without_block ();
11765
+ = parse_expr_without_block (std::move (outer_attrs) );
11766
11766
11767
11767
if (lexer.peek_token ()->get_id () == SEMICOLON)
11768
11768
{
@@ -12437,7 +12437,7 @@ Parser<ManagedTokenSource>::parse_expr (int right_binding_power,
12437
12437
12438
12438
// parse null denotation (unary part of expression)
12439
12439
std::unique_ptr<AST::Expr> expr
12440
- = null_denotation (current_token, std::move (outer_attrs) , restrictions);
12440
+ = null_denotation (current_token, {} , restrictions);
12441
12441
12442
12442
if (expr == nullptr )
12443
12443
{
@@ -12452,8 +12452,8 @@ Parser<ManagedTokenSource>::parse_expr (int right_binding_power,
12452
12452
current_token = lexer.peek_token ();
12453
12453
lexer.skip_token ();
12454
12454
12455
- expr = left_denotation (current_token, std::move (expr), AST::AttrVec (),
12456
- restrictions);
12455
+ expr = left_denotation (current_token, std::move (expr),
12456
+ std::move (outer_attrs), restrictions);
12457
12457
12458
12458
if (expr == nullptr )
12459
12459
{
@@ -13786,7 +13786,7 @@ template <typename ManagedTokenSource>
13786
13786
std::unique_ptr<AST::AssignmentExpr>
13787
13787
Parser<ManagedTokenSource>::parse_assig_expr (
13788
13788
const_TokenPtr tok ATTRIBUTE_UNUSED, std::unique_ptr<AST::Expr> left,
13789
- AST::AttrVec outer_attrs ATTRIBUTE_UNUSED , ParseRestrictions restrictions)
13789
+ AST::AttrVec outer_attrs, ParseRestrictions restrictions)
13790
13790
{
13791
13791
// parse RHS (as tok has already been consumed in parse_expression)
13792
13792
std::unique_ptr<AST::Expr> right
@@ -13799,7 +13799,8 @@ Parser<ManagedTokenSource>::parse_assig_expr (
13799
13799
Location locus = left->get_locus ();
13800
13800
13801
13801
return std::unique_ptr<AST::AssignmentExpr> (
13802
- new AST::AssignmentExpr (std::move (left), std::move (right), locus));
13802
+ new AST::AssignmentExpr (std::move (left), std::move (right),
13803
+ std::move (outer_attrs), locus));
13803
13804
}
13804
13805
13805
13806
/* Returns the left binding power for the given CompoundAssignmentExpr type.
0 commit comments