Skip to content

Construct complex_typet in a non-deprecated way [blocks: #3800] #3903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/ansi-c/ansi_c_convert_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,8 @@ void ansi_c_convert_typet::write(typet &type)
if(complex_cnt)
{
// These take more or less arbitrary subtypes.
complex_typet new_type;
complex_typet new_type(type);
new_type.add_source_location()=source_location;
new_type.subtype()=type;
type.swap(new_type);
}

Expand Down
4 changes: 1 addition & 3 deletions src/ansi-c/literals/convert_integer_literal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@ exprt convert_integer_literal(const std::string &src)

if(is_imaginary)
{
complex_typet complex_type;
complex_type.subtype()=type;
result = complex_exprt(
from_integer(0, type), from_integer(value, type), complex_type);
from_integer(0, type), from_integer(value, type), complex_typet(type));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nest the constructors?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

else
{
Expand Down