work around spurious GCC 13 warnings

* spot/graph/graph.hh (new_univ_dests): Add an overload taking
a temporary vector.
* spot/twa/twagraph.cc (defrag_states): Use it.
* tests/core/parity.cc: Remove some temporary variables.
This commit is contained in:
Alexandre Duret-Lutz 2023-07-26 16:17:31 +02:00
parent 3b59240133
commit 06b1ecb50b
3 changed files with 19 additions and 13 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014-2018, 2020-2022 Laboratoire de Recherche et
// Copyright (C) 2014-2018, 2020-2023 Laboratoire de Recherche et
// Développement de l'Epita.
//
// This file is part of Spot, a model checking library.
@ -576,6 +576,15 @@ namespace spot
return p.first->second;
}
unsigned new_univ_dests(std::vector<unsigned>&& tmp)
{
std::sort(tmp.begin(), tmp.end());
tmp.erase(std::unique(tmp.begin(), tmp.end()), tmp.end());
auto p = uniq_.emplace(tmp, 0);
if (p.second)
p.first->second = g_.new_univ_dests(tmp.begin(), tmp.end());
return p.first->second;
}
};
} // namespace internal

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014-2022 Laboratoire de Recherche et Développement
// Copyright (C) 2014-2023 Laboratoire de Recherche et Développement
// de l'Epita.
//
// This file is part of Spot, a model checking library.
@ -1243,8 +1243,7 @@ namespace spot
// the state so that graph::degrag_states() will
// eventually update it to the correct value.
nd = newst.size();
newst.emplace_back(uniq.new_univ_dests(tmp.begin(),
tmp.end()));
newst.emplace_back(uniq.new_univ_dests(std::move(tmp)));
}
}
in_dst = nd;

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2016, 2018-2019 Laboratoire de Recherche et
// Copyright (C) 2016, 2018-2019, 2023 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
@ -320,16 +320,14 @@ int main()
for (auto acc_tuple: acceptance_sets)
for (auto& aut_tuple: automata_tuples)
{
auto& aut = aut_tuple.first;
auto aut_num_sets = aut_tuple.second;
auto acc = std::get<0>(acc_tuple);
auto is_max = std::get<1>(acc_tuple);
auto is_odd = std::get<2>(acc_tuple);
auto acc_num_sets = std::get<3>(acc_tuple);
spot::twa_graph_ptr& aut = aut_tuple.first;
unsigned aut_num_sets = aut_tuple.second;
unsigned acc_num_sets = std::get<3>(acc_tuple);
if (aut_num_sets <= acc_num_sets)
{
aut->set_acceptance(acc_num_sets, acc);
bool is_max = std::get<1>(acc_tuple);
bool is_odd = std::get<2>(acc_tuple);
aut->set_acceptance(acc_num_sets, std::get<0>(acc_tuple));
// Check change_parity
for (auto kind: parity_kinds)
for (auto style: parity_styles)