Skip to content

Commit d742f58

Browse files
authored
Merge pull request #3613 from tautschnig/vs-local-variables
Remove unused local variables or fix code to use them [blocks: #2310]
2 parents 8dc53f0 + ff1bb87 commit d742f58

File tree

5 files changed

+4
-14
lines changed

5 files changed

+4
-14
lines changed

jbmc/unit/java_bytecode/goto_program_generics/mutually_recursive_generics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ SCENARIO(
7676
reverse.type(),
7777
{{require_type::type_argument_kindt::Var, "java::KeyValue::V"},
7878
{require_type::type_argument_kindt::Var, "java::KeyValue::K"}});
79-
REQUIRE(next_type.subtype().id() == ID_struct_tag);
79+
REQUIRE(reverse_type.subtype().id() == ID_struct_tag);
8080
const struct_tag_typet &reverse_symbol =
8181
to_struct_tag_type(reverse_type.subtype());
8282
REQUIRE(
83-
symbol_table.lookup_ref(next_symbol.get_identifier()).name ==
83+
symbol_table.lookup_ref(reverse_symbol.get_identifier()).name ==
8484
"java::KeyValue");
8585
}
8686
WHEN("The class of type `MutuallyRecursiveGenerics` is created")

jbmc/unit/java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ void validate_lambda_assignment(
107107
Catch::Matchers::Vector::ContainsElementMatcher<irep_idt>{
108108
tmp_class_identifier});
109109

110-
const java_class_typet::componentt super_class_component =
111-
require_type::require_component(tmp_lambda_class_type, "@java.lang.Object");
112-
113-
const struct_tag_typet &super_class_type = require_type::require_struct_tag(
114-
super_class_component.type(), "java::java.lang.Object");
115-
116110
THEN("The function in the class should call the lambda method")
117111
{
118112
const irep_idt method_identifier =

jbmc/unit/solvers/refinement/string_constraint_instantiation/instantiate_not_contains.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ SCENARIO("instantiate_not_contains",
195195
string_constraint_generatort generator(ns);
196196
const auto pair = generator.add_axioms_for_function_application(
197197
generator.fresh_symbol, func);
198-
const exprt &res = pair.first;
199198
const string_constraintst &constraints = pair.second;
200199

201200
std::string axioms;

src/goto-programs/goto_inline_class.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,6 @@ void goto_inlinet::output_inline_map(
739739
goto_functionst::function_mapt::const_iterator f_it=
740740
goto_functions.function_map.find(id);
741741

742-
std::string call="-";
743-
744742
if(f_it!=goto_functions.function_map.end() &&
745743
!call_list.empty())
746744
{

unit/util/range.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ SCENARIO(
105105
THEN("A range of made from the vector can be filtered.")
106106
{
107107
auto odds_filter = make_range(input).filter(is_odd);
108-
std::size_t total = 0;
109-
for(const auto &move_only : odds_filter)
110-
total += 1;
108+
const std::size_t total =
109+
std::distance(odds_filter.begin(), odds_filter.end());
111110
REQUIRE(total == 5);
112111
auto iterator = odds_filter.begin();
113112
REQUIRE((iterator++)->value == 1);

0 commit comments

Comments
 (0)