File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -2045,8 +2045,14 @@ class cppfront
2045
2045
//
2046
2046
auto emit (expression_list_node const & n) -> void
2047
2047
{
2048
- if (should_add_expression_list_parens () && !n.expressions .empty () && !n.inside_initializer ) {
2049
- printer.print_cpp2 (" (" , n.position ());
2048
+ auto add_parens = should_add_expression_list_parens () && !n.inside_initializer ;
2049
+ if (add_parens) {
2050
+ if (n.expressions .empty ()) {
2051
+ printer.print_cpp2 ( " {" , n.position ());
2052
+ }
2053
+ else {
2054
+ printer.print_cpp2 ( " (" , n.position ());
2055
+ }
2050
2056
}
2051
2057
2052
2058
auto first = true ;
@@ -2089,8 +2095,13 @@ class cppfront
2089
2095
}
2090
2096
}
2091
2097
2092
- if (should_add_expression_list_parens () && !n.expressions .empty () && !n.inside_initializer ) {
2093
- printer.print_cpp2 (" )" , n.position ());
2098
+ if (add_parens) {
2099
+ if (n.expressions .empty ()) {
2100
+ printer.print_cpp2 ( " }" , n.position ());
2101
+ }
2102
+ else {
2103
+ printer.print_cpp2 ( " )" , n.position ());
2104
+ }
2094
2105
}
2095
2106
// We want to consume only one of these
2096
2107
consumed_expression_list_parens ();
You can’t perform that action at this time.
0 commit comments