Skip to content

Commit 823c1c4

Browse files
committed
Construct complex_typet in a non-deprecated way
The default constructor is deprecated.
1 parent e2a5430 commit 823c1c4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ansi-c/ansi_c_convert_type.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,8 @@ void ansi_c_convert_typet::write(typet &type)
599599
if(complex_cnt)
600600
{
601601
// These take more or less arbitrary subtypes.
602-
complex_typet new_type;
602+
complex_typet new_type(type);
603603
new_type.add_source_location()=source_location;
604-
new_type.subtype()=type;
605604
type.swap(new_type);
606605
}
607606

src/ansi-c/literals/convert_integer_literal.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,11 @@ exprt convert_integer_literal(const std::string &src)
173173

174174
if(is_imaginary)
175175
{
176-
complex_typet complex_type;
177-
complex_type.subtype()=type;
176+
complex_typet complex_type(type);
178177
result = complex_exprt(
179-
from_integer(0, type), from_integer(value, type), complex_type);
178+
from_integer(0, type),
179+
from_integer(value, type),
180+
std::move(complex_type));
180181
}
181182
else
182183
{

0 commit comments

Comments
 (0)