Skip to content

Commit a75816b

Browse files
committed
Fix ICE in case of operator= with out parameter and no explicit member initializers
1 parent 923e0f3 commit a75816b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/cppfront.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4387,11 +4387,10 @@ class cppfront
43874387
return;
43884388
}
43894389

4390-
assert(out_inits.empty());
43914390
// Flush any possible remaining 'out' parameters (shouldn't be any...)
4392-
//for (auto& init : out_inits) {
4393-
// current_functions.back().prolog.statements.push_back(init);
4394-
//}
4391+
for (auto& init : out_inits) {
4392+
current_functions.back().prolog.statements.push_back(init + ";");
4393+
}
43954394
}
43964395

43974396
// For a constructor, print the type name instead of the operator= function name

0 commit comments

Comments
 (0)