Skip to content

Commit 96f5780

Browse files
Update CI to use clang-tidy 14 (#6353)
1 parent c003ac1 commit 96f5780

22 files changed

+24
-35
lines changed

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Checks: >
1212
-bugprone-unhandled-self-assignment,
1313
-bugprone-forward-declaration-namespace,
1414
-bugprone-sizeof-expression,
15+
-bugprone-throw-keyword-missing,
1516
-clang-analyzer-*,
1617
-clang-diagnostic-deprecated-declarations,
1718
-clang-diagnostic-constant-conversion,
@@ -64,6 +65,7 @@ Checks: >
6465
-readability-else-after-return,
6566
-readability-inconsistent-declaration-parameter-name,
6667
-readability-isolate-declaration,
68+
-readability-identifier-length,
6769
-readability-redundant-declaration,
6870
-readability-uppercase-literal-suffix,
6971
-readability-named-parameter,

.github/workflows/osrm-backend.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ jobs:
145145
- name: clang-11.0-debug-clang-tidy
146146
continue-on-error: false
147147
node: 12
148-
runs-on: ubuntu-20.04
148+
runs-on: ubuntu-22.04
149149
BUILD_TOOLS: ON
150150
BUILD_TYPE: Debug
151-
CCOMPILER: clang-11
152-
CXXCOMPILER: clang++-11
151+
CCOMPILER: clang-14
152+
CXXCOMPILER: clang++-14
153153
CUCUMBER_TIMEOUT: 60000
154154
ENABLE_CLANG_TIDY: ON
155155

include/engine/api/table_api.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ namespace api
3232
class TableAPI final : public BaseAPI
3333
{
3434
public:
35+
virtual ~TableAPI() = default;
36+
3537
struct TableCellRef
3638
{
3739
TableCellRef(const std::size_t &row, const std::size_t &column) : row{row}, column{column}

include/engine/datafacade/algorithm_datafacade.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ template <> class AlgorithmDataFacade<CH>
3131
using EdgeData = contractor::QueryEdge::EdgeData;
3232
using EdgeRange = util::filtered_range<EdgeID, util::vector_view<bool>>;
3333

34+
virtual ~AlgorithmDataFacade() = default;
35+
3436
// search graph access
3537
virtual unsigned GetNumberOfNodes() const = 0;
3638

@@ -66,6 +68,8 @@ template <> class AlgorithmDataFacade<MLD>
6668
using EdgeData = customizer::EdgeBasedGraphEdgeData;
6769
using EdgeRange = util::range<EdgeID>;
6870

71+
virtual ~AlgorithmDataFacade() = default;
72+
6973
// search graph access
7074
virtual unsigned GetNumberOfNodes() const = 0;
7175

include/engine/routing_algorithms.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ namespace engine
1919
class RoutingAlgorithmsInterface
2020
{
2121
public:
22+
virtual ~RoutingAlgorithmsInterface() = default;
23+
2224
virtual InternalManyRoutesResult
2325
AlternativePathSearch(const PhantomEndpointCandidates &endpoint_candidates,
2426
unsigned number_of_alternatives) const = 0;

include/extractor/raster_source.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class RasterGrid
5858
for (unsigned int y = 0; y < ydim; y++)
5959
{
6060
// read one line from file.
61-
file_reader.ReadLine(&buffer[0], xdim * 11);
61+
file_reader.ReadLine(buffer.data(), xdim * 11);
6262
boost::algorithm::trim(buffer);
6363

6464
std::vector<std::string> result;

include/partitioner/partition_graph.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ template <typename NodeEntryT, typename EdgeEntryT> class RemappableGraph
125125

126126
NodeID GetID(const NodeT &node) const
127127
{
128-
BOOST_ASSERT(&node >= &nodes[0] && &node <= &nodes.back());
129-
return (&node - &nodes[0]);
128+
BOOST_ASSERT(&node >= nodes.data() && &node <= &nodes.back());
129+
return (&node - nodes.data());
130130
}
131131
EdgeID GetID(const EdgeT &edge) const
132132
{
133-
BOOST_ASSERT(&edge >= &edges[0] && &edge <= &edges.back());
134-
return (&edge - &edges[0]);
133+
BOOST_ASSERT(&edge >= edges.data() && &edge <= &edges.back());
134+
return (&edge - edges.data());
135135
}
136136

137137
NodeIterator Begin() { return nodes.begin(); }
@@ -142,7 +142,7 @@ template <typename NodeEntryT, typename EdgeEntryT> class RemappableGraph
142142
// removes the edges from the graph that return true for the filter, returns new end
143143
template <typename FilterT> auto RemoveEdges(NodeT &node, FilterT filter)
144144
{
145-
BOOST_ASSERT(&node >= &nodes[0] && &node <= &nodes.back());
145+
BOOST_ASSERT(&node >= nodes.data() && &node <= &nodes.back());
146146
// required since we are not on std++17 yet, otherwise we are missing an argument_type
147147
const auto negate_filter = [&](const EdgeT &edge) { return !filter(edge); };
148148
const auto center = std::stable_partition(BeginEdges(node), EndEdges(node), negate_filter);

include/storage/view_factory.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
#include "util/vector_view.hpp"
3737

3838
#include "util/filtered_graph.hpp"
39-
#include "util/packed_vector.hpp"
40-
#include "util/vector_view.hpp"
41-
4239
namespace osrm
4340
{
4441
namespace storage

include/util/dist_table_wrapper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ template <typename T> class DistTableWrapper
2525
DistTableWrapper(std::vector<T> table, std::size_t number_of_nodes)
2626
: table_(std::move(table)), number_of_nodes_(number_of_nodes)
2727
{
28-
BOOST_ASSERT_MSG(table.size() == 0, "table is empty");
28+
BOOST_ASSERT_MSG(!table_.empty(), "table is empty");
2929
BOOST_ASSERT_MSG(number_of_nodes_ * number_of_nodes_ <= table_.size(),
3030
"number_of_nodes_ is invalid");
3131
}

include/util/filtered_graph.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ class FilteredGraphImpl<util::StaticGraph<EdgeDataT, Ownership>, Ownership>
126126

127127
FilteredGraphImpl() = default;
128128

129-
FilteredGraphImpl(Graph graph, Vector<bool> edge_filter_)
130-
: graph(std::move(graph)), edge_filter(std::move(edge_filter_))
129+
FilteredGraphImpl(Graph graph_, Vector<bool> edge_filter_)
130+
: graph(std::move(graph_)), edge_filter(std::move(edge_filter_))
131131
{
132132
BOOST_ASSERT(edge_filter.empty() || edge_filter.size() == graph.GetNumberOfEdges());
133133
}

0 commit comments

Comments
 (0)