Skip to content

Commit 934eb99

Browse files
committed
fix: lower _braced-init-list_ argument correctly
1 parent ce8bbbc commit 934eb99

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

regression-tests/test-results/pure2-bugfix-for-nested-lists.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ point::point(){}
6767
[[nodiscard]] auto check(cpp2::in<point> p) -> auto { return p; }
6868

6969
auto main() -> int{
70-
if (cpp2::Default.has_handler() && !(check({17, 29}).x == 17) ) { cpp2::Default.report_violation(""); }
71-
if (cpp2::Default.has_handler() && !(check({17, 29}).y == 29) ) { cpp2::Default.report_violation(""); }
70+
if (cpp2::Default.has_handler() && !(check({ 17, 29 }).x == 17) ) { cpp2::Default.report_violation(""); }
71+
if (cpp2::Default.has_handler() && !(check({ 17, 29 }).y == 29) ) { cpp2::Default.report_violation(""); }
7272

7373
std::array<std::array<cpp2::u8,3>,3> board {{ {
7474
'O', 'X', 'O' }, {

source/parse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5746,7 +5746,7 @@ class parser
57465746
// If not, then this wasn't a call expression so backtrack to
57475747
// the '(' which will be part of the next grammar production
57485748

5749-
term.expr_list = expression_list(term.op);
5749+
term.expr_list = expression_list(term.op, true);
57505750
if (
57515751
term.expr_list
57525752
&& curr().type() == lexeme::RightParen

source/to_cpp1.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3132,12 +3132,6 @@ class cppfront
31323132
if (args) {
31333133
suffix.emplace_back(")", args.value().close_pos);
31343134
for (auto&& e: args.value().text_chunks) {
3135-
if (e.text == "(") {
3136-
e.text = "{";
3137-
}
3138-
else if (e.text == ")") {
3139-
e.text = "}";
3140-
}
31413135
suffix.push_back(e);
31423136
}
31433137
suffix.emplace_back("(", args.value().open_pos);

0 commit comments

Comments
 (0)