@@ -661,6 +661,7 @@ struct expression_list_node
661661 token const * open_paren = {};
662662 token const * close_paren = {};
663663 bool inside_initializer = false ;
664+ bool default_initializer = false ;
664665
665666 struct term {
666667 passing_style pass = {};
@@ -5393,6 +5394,7 @@ class parser
53935394 };
53945395 mutable std::vector<function_body_extent> function_body_extents;
53955396 mutable bool is_function_body_extents_sorted = false ;
5397+ bool is_inside_call_expr = false ;
53965398
53975399public:
53985400 auto is_within_function_body (source_position p) const
@@ -5747,6 +5749,8 @@ class parser
57475749 expr_list->inside_initializer = false ;
57485750 }
57495751 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 );
57505754 n->expr = std::move (expr_list);
57515755 return n;
57525756 }
@@ -5899,8 +5903,12 @@ class parser
58995903 // Next should be an expression-list followed by a ')'
59005904 // If not, then this wasn't a call expression so backtrack to
59015905 // the '(' which will be part of the next grammar production
5906+ is_inside_call_expr = true ;
59025907
59035908 term.expr_list = expression_list (term.op , lexeme::RightParen);
5909+
5910+ is_inside_call_expr = false ;
5911+
59045912 if (
59055913 term.expr_list
59065914 && curr ().type () == lexeme::RightParen
0 commit comments