File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1086,15 +1086,12 @@ class cppfront
1086
1086
}
1087
1087
1088
1088
in_definite_init = is_definite_initialization (n.identifier );
1089
- if (in_synthesized_multi_return) {
1090
- printer.print_cpp2 (" .value()" , n.position ());
1091
- }
1092
- else if (!in_definite_init && !in_parameter_list) {
1089
+ if (!in_definite_init && !in_parameter_list) {
1093
1090
if (auto decl = sema.get_declaration_of (*n.identifier );
1094
1091
is_local_name &&
1095
1092
decl &&
1096
1093
// note pointer equality: if we're not in the actual declaration of n.identifier
1097
- decl->identifier != n.identifier &&
1094
+ (in_synthesized_multi_return || decl->identifier != n.identifier ) &&
1098
1095
// and this variable was uninitialized
1099
1096
!decl->initializer &&
1100
1097
// and it's either a non-parameter or an out parameter
@@ -1104,6 +1101,9 @@ class cppfront
1104
1101
printer.print_cpp2 (" .value()" , n.position ());
1105
1102
}
1106
1103
}
1104
+ else if (in_synthesized_multi_return) {
1105
+ printer.print_cpp2 (" .value()" , n.position ());
1106
+ }
1107
1107
1108
1108
if (add_std_move || add_std_forward) {
1109
1109
printer.print_cpp2 (" )" , n.position ());
Original file line number Diff line number Diff line change @@ -253,6 +253,7 @@ class sema
253
253
assert (decl.declaration );
254
254
if (
255
255
decl.declaration ->type .index () == declaration_node::function // Don't look beyond the current function
256
+ && decl.declaration ->identifier // nullptr if lambda
256
257
) {
257
258
return nullptr ;
258
259
}
You can’t perform that action at this time.
0 commit comments