Skip to content

Commit 2c944dc

Browse files
author
Pamina Georgiou
committed
fix build fail due to -Wrange-loop-analysis
1 parent aa5a40a commit 2c944dc

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

src/goto-programs/goto_program.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ bool goto_programt::equals(const goto_programt &other) const
10931093

10941094
// the number of targets is the same as instructiont::equals returned "true"
10951095
auto other_target_it = other_it->targets.begin();
1096-
for(const auto t : ins.targets)
1096+
for(const auto &t : ins.targets)
10971097
{
10981098
if(
10991099
t->location_number - ins.location_number !=

src/goto-symex/build_goto_trace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ void build_goto_trace(
329329

330330
for(const auto &time_and_ssa_steps : time_map)
331331
{
332-
for(const auto ssa_step_it : time_and_ssa_steps.second)
332+
for(const auto &ssa_step_it : time_and_ssa_steps.second)
333333
{
334334
const auto &SSA_step = *ssa_step_it;
335335
goto_trace.steps.push_back(goto_trace_stept());

src/solvers/sat/cnf.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ literalt cnft::land(const bvt &bv)
166166
if(bv.size()==2)
167167
return land(bv[0], bv[1]);
168168

169-
for(const auto l : bv)
169+
for(const auto &l : bv)
170170
if(l.is_false())
171171
return l;
172172

@@ -179,7 +179,7 @@ literalt cnft::land(const bvt &bv)
179179
literalt literal=new_variable();
180180
lits[1]=neg(literal);
181181

182-
for(const auto l : new_bv)
182+
for(const auto &l : new_bv)
183183
{
184184
lits[0]=pos(l);
185185
lcnf(lits);
@@ -188,7 +188,7 @@ literalt cnft::land(const bvt &bv)
188188
lits.clear();
189189
lits.reserve(new_bv.size()+1);
190190

191-
for(const auto l : new_bv)
191+
for(const auto &l : new_bv)
192192
lits.push_back(neg(l));
193193

194194
lits.push_back(pos(literal));
@@ -209,7 +209,7 @@ literalt cnft::lor(const bvt &bv)
209209
if(bv.size()==2)
210210
return lor(bv[0], bv[1]);
211211

212-
for(const auto l : bv)
212+
for(const auto &l : bv)
213213
if(l.is_true())
214214
return l;
215215

@@ -222,7 +222,7 @@ literalt cnft::lor(const bvt &bv)
222222
literalt literal=new_variable();
223223
lits[1]=pos(literal);
224224

225-
for(const auto l : new_bv)
225+
for(const auto &l : new_bv)
226226
{
227227
lits[0]=neg(l);
228228
lcnf(lits);
@@ -231,7 +231,7 @@ literalt cnft::lor(const bvt &bv)
231231
lits.clear();
232232
lits.reserve(new_bv.size()+1);
233233

234-
for(const auto l : new_bv)
234+
for(const auto &l : new_bv)
235235
lits.push_back(pos(l));
236236

237237
lits.push_back(neg(literal));
@@ -254,7 +254,7 @@ literalt cnft::lxor(const bvt &bv)
254254

255255
literalt literal=const_literal(false);
256256

257-
for(const auto l : bv)
257+
for(const auto &l : bv)
258258
literal=lxor(l, literal);
259259

260260
return literal;
@@ -404,7 +404,7 @@ bvt cnft::eliminate_duplicates(const bvt &bv)
404404
bvt dest;
405405
dest.reserve(bv.size());
406406

407-
for(const auto l : bv)
407+
for(const auto &l : bv)
408408
if(s.insert(l).second)
409409
dest.push_back(l);
410410

@@ -423,7 +423,7 @@ bool cnft::process_clause(const bvt &bv, bvt &dest)
423423

424424
// first check simple things
425425

426-
for(const auto l : bv)
426+
for(const auto &l : bv)
427427
{
428428
// we never use index 0
429429
INVARIANT(l.var_no() != 0, "variable 0 must not be used");
@@ -449,7 +449,7 @@ bool cnft::process_clause(const bvt &bv, bvt &dest)
449449
dest.clear();
450450
dest.reserve(bv.size());
451451

452-
for(const auto l : bv)
452+
for(const auto &l : bv)
453453
{
454454
if(l.is_false())
455455
continue; // remove

src/solvers/solver_hardness.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void solver_hardnesst::produce_report()
165165
json_stringt{assertion_stats.ssa_expression};
166166

167167
auto assertion_stats_pcs_json = json_arrayt{};
168-
for(const auto pc : assertion_stats.pcs)
168+
for(const auto &pc : assertion_stats.pcs)
169169
{
170170
auto assertion_stats_pc_json = json_objectt{};
171171
assertion_stats_pc_json["GOTO"] =

src/util/graph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ std::vector<typename N::node_indext> grapht<N>::get_reachable(
632632

633633
const auto &node = nodes[n];
634634
const auto &succs = forwards ? node.out : node.in;
635-
for(const auto succ : succs)
635+
for(const auto &succ : succs)
636636
if(!visited[succ.first])
637637
s.push(succ.first);
638638
}

src/util/sharing_map.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ ::iterate(
619619
const to_mapt &m = ip->get_to_map();
620620
SM_ASSERT(!m.empty());
621621

622-
for(const auto &item : m)
622+
for(const auto item : m)
623623
{
624624
stack.push(&item.second);
625625
}
@@ -694,7 +694,7 @@ ::count_unmarked_nodes(
694694
const to_mapt &m = ip->get_to_map();
695695
SM_ASSERT(!m.empty());
696696

697-
for(const auto &item : m)
697+
for(const auto item : m)
698698
{
699699
stack.push(&item.second);
700700
}
@@ -939,7 +939,7 @@ ::get_delta_view(
939939

940940
if(ip2->is_internal())
941941
{
942-
for(const auto &item : ip1->get_to_map())
942+
for(const auto item : ip1->get_to_map())
943943
{
944944
const nodet &child = item.second;
945945

@@ -964,7 +964,7 @@ ::get_delta_view(
964964
{
965965
SM_ASSERT(ip2->is_leaf());
966966

967-
for(const auto &item : ip1->get_to_map())
967+
for(const auto item : ip1->get_to_map())
968968
{
969969
const nodet &child = item.second;
970970

0 commit comments

Comments
 (0)