Skip to content

Use source_locationt::nil() instead of local static_cast #6640

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
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
2 changes: 1 addition & 1 deletion src/cpp/cpp_name.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class cpp_namet:public irept
const source_locationt &source_location() const
{
if(get_sub().empty())
return static_cast<const source_locationt &>(get_nil_irep());
return source_locationt::nil();
else
return static_cast<const source_locationt &>(
get_sub().front().find(ID_C_source_location));
Expand Down
2 changes: 1 addition & 1 deletion src/goto-programs/goto_program.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ class goto_programt

explicit instructiont(goto_program_instruction_typet __type)
: code(static_cast<const codet &>(get_nil_irep())),
_source_location(static_cast<const source_locationt &>(get_nil_irep())),
_source_location(source_locationt::nil()),
_type(__type),
guard(true_exprt())
{
Expand Down
2 changes: 1 addition & 1 deletion src/util/expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const source_locationt &exprt::find_source_location() const
return op_l;
}

return static_cast<const source_locationt &>(get_nil_irep());
return source_locationt::nil();
}

template <typename T>
Expand Down