Skip to content

Commit ad5bfd3

Browse files
[cicd] use stable clang 14 while 15 broken (#311)
* [cicd] use stable clang 14 while 15 broken
1 parent 46a9262 commit ad5bfd3

File tree

5 files changed

+31
-42
lines changed

5 files changed

+31
-42
lines changed

.github/workflows/clang_tidy.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ jobs:
1414
uses: actions/checkout@v3.1.0
1515
- name: Install
1616
run: |
17-
wget https://apt.llvm.org/llvm.sh
18-
chmod +x llvm.sh
19-
sudo ./llvm.sh 15 all
2017
( cd /tmp
2118
git clone --depth 1 "https://gitlab.com/libeigen/eigen"
2219
cmake -S "eigen" -B "eigen/build"
@@ -40,7 +37,7 @@ jobs:
4037
- name: Verify
4138
run: |
4239
FILES="include/fcarouge/kalman.hpp benchmark/include/benchmark.hpp"
43-
clang-tidy-15 ${FILES} --warnings-as-errors=* -- \
40+
clang-tidy-14 ${FILES} --warnings-as-errors=* -- \
4441
-x c++ -Iinclude \
4542
-I/usr/local/include/eigen3 \
4643
-Isupport \

.github/workflows/format.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ jobs:
1414
uses: actions/checkout@v3
1515
- name: "Install"
1616
run: |
17-
wget https://apt.llvm.org/llvm.sh
18-
chmod +x llvm.sh
19-
sudo ./llvm.sh 15 all
2017
pip install cmakelang
2118
- name: "Test"
2219
run: |
2320
find . -iname "*.hpp" -o -iname "*.tpp" -o -iname "*.cpp" -o -iwholename "./support/format" | xargs \
24-
clang-format-15 --Werror --dry-run --verbose -style=file
21+
clang-format-14 --Werror --dry-run --verbose -style=file
2522
cmake-format --check CMakeLists.txt

include/fcarouge/internal/kalman.tpp

+15-18
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,15 @@ template <typename State, typename Output, typename Input, typename UpdateTypes,
8181
"discarded.")]] inline constexpr auto
8282
kalman<State, Output, Input, UpdateTypes, PredictionTypes>::u() const
8383
-> const input &requires(not std::is_same_v<Input, void>) {
84-
return filter.u;
85-
}
84+
return filter.u;
85+
}
8686

8787
template <typename State, typename Output, typename Input, typename UpdateTypes,
8888
typename PredictionTypes>
8989
[[nodiscard("The returned estimated covariance matrix P is unexpectedly "
90-
"discarded.")]] inline constexpr auto kalman<State, Output, Input,
91-
UpdateTypes,
92-
PredictionTypes>::p()
93-
const -> const estimate_uncertainty & {
90+
"discarded.")]] inline constexpr auto
91+
kalman<State, Output, Input, UpdateTypes, PredictionTypes>::p() const
92+
-> const estimate_uncertainty & {
9493
return filter.p;
9594
}
9695

@@ -245,26 +244,24 @@ template <typename State, typename Output, typename Input, typename UpdateTypes,
245244
"discarded.")]] inline constexpr auto
246245
kalman<State, Output, Input, UpdateTypes, PredictionTypes>::g() const
247246
-> const input_control &requires(not std::is_same_v<Input, void>) {
248-
return filter.g;
249-
}
247+
return filter.g;
248+
}
250249

251250
template <typename State, typename Output, typename Input, typename UpdateTypes,
252251
typename PredictionTypes>
253252
[[nodiscard("The returned control transition matrix G is unexpectedly "
254-
"discarded.")]] inline constexpr auto kalman<State, Output, Input,
255-
UpdateTypes,
256-
PredictionTypes>::g()
253+
"discarded.")]] inline constexpr auto
254+
kalman<State, Output, Input, UpdateTypes, PredictionTypes>::g()
257255
-> input_control &requires(not std::is_same_v<Input, void>) {
258-
return filter.g;
259-
}
256+
return filter.g;
257+
}
260258

261259
template <typename State, typename Output, typename Input, typename UpdateTypes,
262260
typename PredictionTypes>
263-
inline constexpr void kalman<State, Output, Input, UpdateTypes,
264-
PredictionTypes>::g(const auto &value,
265-
const auto &...values)
266-
requires(not std::is_same_v<Input, void>)
267-
{
261+
inline constexpr void
262+
kalman<State, Output, Input, UpdateTypes, PredictionTypes>::g(
263+
const auto &value,
264+
const auto &...values) requires(not std::is_same_v<Input, void>) {
268265
if constexpr (std::is_convertible_v<decltype(value), input_control>) {
269266
filter.g = std::move(input_control{value, values...});
270267
} else {

include/fcarouge/internal/utility.hpp

+11-14
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ template <typename Type>
4848
concept arithmetic = std::integral<Type> || std::floating_point<Type>;
4949

5050
template <typename Type>
51-
concept algebraic = not
52-
arithmetic<Type>;
51+
concept algebraic = not arithmetic<Type>;
5352

5453
struct empty {
5554
inline constexpr explicit empty([[maybe_unused]] auto &&...any) noexcept {
@@ -61,9 +60,7 @@ template <typename...> struct pack {};
6160

6261
using empty_pack = pack<>;
6362

64-
template <typename Type> struct repack {
65-
using type = Type;
66-
};
63+
template <typename Type> struct repack { using type = Type; };
6764

6865
template <template <typename...> typename From, typename... Types>
6966
struct repack<From<Types...>> {
@@ -92,7 +89,7 @@ template <arithmetic Arithmetic>
9289
inline constexpr Arithmetic identity_v<Arithmetic>{1};
9390

9491
template <typename Matrix>
95-
requires requires(Matrix value) { value.Identity(); }
92+
requires requires(Matrix value) { value.Identity(); }
9693
inline const auto identity_v<Matrix>{Matrix::Identity()};
9794

9895
template <typename Type>
@@ -104,7 +101,7 @@ template <arithmetic Arithmetic>
104101
inline constexpr Arithmetic zero_v<Arithmetic>{0};
105102

106103
template <typename Matrix>
107-
requires requires(Matrix value) { value.Zero(); }
104+
requires requires(Matrix value) { value.Zero(); }
108105
inline const auto zero_v<Matrix>{Matrix::Zero()};
109106

110107
struct transpose final {
@@ -115,7 +112,7 @@ struct transpose final {
115112
}
116113

117114
template <typename Matrix>
118-
requires requires(Matrix value) { value.transpose(); }
115+
requires requires(Matrix value) { value.transpose(); }
119116
[[nodiscard]] inline constexpr auto operator()(const Matrix &value) const {
120117
return value.transpose();
121118
}
@@ -139,22 +136,22 @@ struct deducer final {
139136

140137
// Eigen's types deductions.
141138
template <typename Lhs, typename Rhs>
142-
requires requires(Lhs lhs, Rhs rhs) {
143-
typename Lhs::PlainMatrix;
144-
typename Lhs::PlainMatrix;
145-
}
139+
requires requires(Lhs lhs, Rhs rhs) {
140+
typename Lhs::PlainMatrix;
141+
typename Lhs::PlainMatrix;
142+
}
146143
[[nodiscard]] inline constexpr auto operator()(const Lhs &lhs,
147144
const Rhs &rhs) const ->
148145
typename decltype(lhs * rhs.transpose())::PlainMatrix;
149146

150147
template <typename Lhs, arithmetic Rhs>
151-
requires requires(Lhs lhs) { typename Lhs::PlainMatrix; }
148+
requires requires(Lhs lhs) { typename Lhs::PlainMatrix; }
152149
[[nodiscard]] inline constexpr auto operator()(const Lhs &lhs,
153150
const Rhs &rhs) const ->
154151
typename Lhs::PlainMatrix;
155152

156153
template <arithmetic Lhs, typename Rhs>
157-
requires requires(Rhs rhs) { typename Rhs::PlainMatrix; }
154+
requires requires(Rhs rhs) { typename Rhs::PlainMatrix; }
158155
[[nodiscard]] inline constexpr auto operator()(const Lhs &lhs,
159156
const Rhs &rhs) const ->
160157
typename decltype(rhs.transpose())::PlainMatrix;

include/fcarouge/kalman.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,9 @@ class kalman final {
518518
//! control transition matrix G.
519519
//!
520520
//! @complexity Constant.
521-
inline constexpr void g(const auto &value, const auto &...values)
522-
requires(not std::is_same_v<Input, void>);
521+
inline constexpr void
522+
g(const auto &value,
523+
const auto &...values) requires(not std::is_same_v<Input, void>);
523524

524525
//! @brief Returns the gain matrix K.
525526
//!

0 commit comments

Comments
 (0)