Skip to content

Commit 3a7de29

Browse files
authored
Merge pull request #3903 from tautschnig/deprecation-complex_typet
Construct complex_typet in a non-deprecated way [blocks: #3800]
2 parents b2c7d24 + fd1d394 commit 3a7de29

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,8 @@ exprt convert_integer_literal(const std::string &src)
173173

174174
if(is_imaginary)
175175
{
176-
complex_typet complex_type;
177-
complex_type.subtype()=type;
178176
result = complex_exprt(
179-
from_integer(0, type), from_integer(value, type), complex_type);
177+
from_integer(0, type), from_integer(value, type), complex_typet(type));
180178
}
181179
else
182180
{

0 commit comments

Comments
 (0)