Skip to content

Commit 4bae1df

Browse files
author
Daniel Kroening
committed
use full side_effect_expr_function_callt constructor
1 parent 76f145d commit 4bae1df

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/cpp/cpp_constructor.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,11 @@ optionalt<codet> cpp_typecheckt::cpp_constructor(
222222
// there is always a constructor for non-PODs
223223
assert(constructor_name!="");
224224

225-
side_effect_expr_function_callt function_call;
226-
function_call.add_source_location()=source_location;
227-
function_call.function() =
228-
cpp_namet(constructor_name, source_location).as_expr();
229-
function_call.arguments().reserve(operands_tc.size());
225+
side_effect_expr_function_callt function_call(
226+
cpp_namet(constructor_name, source_location).as_expr(),
227+
operands_tc);
230228

231-
for(auto &op : operands_tc)
232-
function_call.op1().copy_to_operands(op);
229+
function_call.add_source_location()=source_location;
233230

234231
typecheck_side_effect_function_call(function_call);
235232
assert(function_call.get(ID_statement)==ID_temporary_object);

0 commit comments

Comments
 (0)