Skip to content

Commit 5161a7e

Browse files
tautschnigDaniel Kroening
authored and
Daniel Kroening
committed
Avoid default constructing code_expressiont
The default constructor is deprecated.
1 parent bb2a0f1 commit 5161a7e

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/cpp/cpp_constructor.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ optionalt<codet> cpp_typecheckt::cpp_constructor(
144144
side_effect_expr_assignt assign(
145145
object_tc, operands_tc.front(), typet(), source_location);
146146
typecheck_side_effect_assignment(assign);
147-
code_expressiont new_code;
148-
new_code.expression()=assign;
149-
return std::move(new_code);
147+
return code_expressiont(std::move(assign));
150148
}
151149
else
152150
{

src/cpp/cpp_typecheck_code.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ void cpp_typecheckt::typecheck_member_initializer(codet &code)
244244
}
245245
}
246246

247-
code_expressiont code_expression;
248-
code_expression.expression()=function_call;
247+
code_expressiont code_expression(function_call);
249248

250249
code.swap(code_expression);
251250
}

0 commit comments

Comments
 (0)