@@ -661,6 +661,7 @@ struct expression_list_node
661
661
token const * open_paren = {};
662
662
token const * close_paren = {};
663
663
bool inside_initializer = false ;
664
+ bool default_initializer = false ;
664
665
665
666
struct term {
666
667
passing_style pass = {};
@@ -5393,6 +5394,7 @@ class parser
5393
5394
};
5394
5395
mutable std::vector<function_body_extent> function_body_extents;
5395
5396
mutable bool is_function_body_extents_sorted = false ;
5397
+ bool is_inside_call_expr = false ;
5396
5398
5397
5399
public:
5398
5400
auto is_within_function_body (source_position p) const
@@ -5747,6 +5749,8 @@ class parser
5747
5749
expr_list->inside_initializer = false ;
5748
5750
}
5749
5751
n->expression_list_is_fold_expression = expr_list->is_fold_expression ();
5752
+ expr_list->default_initializer =
5753
+ is_inside_call_expr && std::empty (expr_list->expressions );
5750
5754
n->expr = std::move (expr_list);
5751
5755
return n;
5752
5756
}
@@ -5899,8 +5903,12 @@ class parser
5899
5903
// Next should be an expression-list followed by a ')'
5900
5904
// If not, then this wasn't a call expression so backtrack to
5901
5905
// the '(' which will be part of the next grammar production
5906
+ is_inside_call_expr = true ;
5902
5907
5903
5908
term.expr_list = expression_list (term.op , lexeme::RightParen);
5909
+
5910
+ is_inside_call_expr = false ;
5911
+
5904
5912
if (
5905
5913
term.expr_list
5906
5914
&& curr ().type () == lexeme::RightParen
0 commit comments