diff --git a/.github/workflows/programming_team_code_ci.yml b/.github/workflows/programming_team_code_ci.yml index 756d14b4..a4979953 100644 --- a/.github/workflows/programming_team_code_ci.yml +++ b/.github/workflows/programming_team_code_ci.yml @@ -39,7 +39,7 @@ jobs: sudo apt install -y wget software-properties-common wget -O - https://apt.llvm.org/llvm.sh | sudo bash - name: Install dependencies - run: sudo apt update && sudo apt install -y clang-format-18 cppcheck + run: sudo apt update && sudo apt install -y clang-format-19 cppcheck - name: checks format then lints run: make --directory=tests/ check_format_lint @@ -53,7 +53,7 @@ jobs: sudo apt install -y wget software-properties-common wget -O - https://apt.llvm.org/llvm.sh | sudo bash - name: Install dependencies - run: sudo apt update && sudo apt install -y clang-tidy-18 + run: sudo apt update && sudo apt install -y clang-tidy-19 - name: clang-tidy run: make --directory=tests/ clangtidy @@ -68,8 +68,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Set up LLVM repository + run: wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 19 - name: Install dependencies - run: wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 18 + run: sudo apt update && sudo apt install -y clang-19 - name: Compile all tests run: make --directory=tests/ compile_clang @@ -88,10 +90,11 @@ jobs: run: | sudo apt update sudo apt install texlive texlive-latex-extra rename nodejs npm - wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 18 + wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 19 + sudo apt update && sudo apt install -y clang-19 - name: build ptc run: make --directory=tests/ ptc - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ptc path: tests/ptc.pdf @@ -102,7 +105,7 @@ jobs: if: github.ref == 'refs/heads/dev' && github.event_name == 'push' steps: - uses: actions/checkout@v2 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ptc path: tests/ptc.pdf @@ -126,7 +129,7 @@ jobs: sudo apt install -y wget software-properties-common wget -O - https://apt.llvm.org/llvm.sh | sudo bash - name: Install dependencies - run: sudo apt update && sudo apt install -y clang-format-18 + run: sudo apt update && sudo apt install -y clang-format-19 - name: Combine includes and force push to main branch run: | git config --local user.name github-actions diff --git a/library/contest/dynamic_bitset.hpp b/library/contest/dynamic_bitset.hpp deleted file mode 100644 index e68446d7..00000000 --- a/library/contest/dynamic_bitset.hpp +++ /dev/null @@ -1,24 +0,0 @@ -//! https://codeforces.com/blog/entry/129454 -//! https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a09090.html -#include -using namespace tr2; -void f() { - dynamic_bitset<> bs(65); - assert(bs.bits_per_block == 64); - assert(bs.num_blocks() == 2); - assert(bs.none()); - bs[1] = bs[3] = 1; - assert(bs.any()); - assert(bs.count() == 2); - assert(ssize(bs) == 65); - bs |= bs & bs; - assert( - bs == bs && !(bs != bs) && !(bs < bs) && bs <= bs); - bs.resize(10); - bs.push_back(0); - cerr << bs << endl; - for (int i = bs.find_first(); i != ssize(bs); - i = bs.find_next(i)) - cerr << i << endl; - bs -= bs; // bs &= ~bs; -} diff --git a/library/data_structures/uncommon/priority_queue_of_updates.hpp b/library/data_structures/uncommon/priority_queue_of_updates.hpp index 146aac0e..7796a03d 100644 --- a/library/data_structures/uncommon/priority_queue_of_updates.hpp +++ b/library/data_structures/uncommon/priority_queue_of_updates.hpp @@ -34,7 +34,7 @@ template struct pq_updates { vector extra; int idx = sz(upd_st) - 1, lowest_pri = INT_MAX; for (auto it = rbegin(mp); - 2 * sz(extra) < sz(upd_st) - idx; it++) { + 2 * sz(extra) < sz(upd_st) - idx; it++) { auto [pri, idx_sk] = *it; extra.push_back(upd_st[idx_sk]); idx = min(idx, idx_sk), lowest_pri = pri; diff --git a/library/loops/chooses.hpp b/library/loops/chooses.hpp index 5f932355..3b98c752 100644 --- a/library/loops/chooses.hpp +++ b/library/loops/chooses.hpp @@ -5,4 +5,4 @@ //! @time O(n choose k) //! @space O(1) for (int mask = (1 << k) - 1; mask < (1 << n); - mask = next_subset(mask)) + mask = next_subset(mask)) diff --git a/library/loops/submasks.hpp b/library/loops/submasks.hpp index 6216f537..200777c1 100644 --- a/library/loops/submasks.hpp +++ b/library/loops/submasks.hpp @@ -5,4 +5,4 @@ //! of every mask of size n //! @space O(1) for (int submask = mask; submask; - submask = (submask - 1) & mask) + submask = (submask - 1) & mask) diff --git a/library/loops/supermasks.hpp b/library/loops/supermasks.hpp index 9b468e3a..05864afc 100644 --- a/library/loops/supermasks.hpp +++ b/library/loops/supermasks.hpp @@ -6,4 +6,4 @@ //! of every mask of size n //! @space O(1) for (int supermask = mask; supermask < (1 << n); - supermask = (supermask + 1) | mask) + supermask = (supermask + 1) | mask) diff --git a/library/math/partitions.hpp b/library/math/partitions.hpp index fd6d350c..822ed670 100644 --- a/library/math/partitions.hpp +++ b/library/math/partitions.hpp @@ -12,7 +12,7 @@ vector partitions(int n) { rep(i, 1, n) { ll sum = 0; for (int j = 1, pent = 1, sign = 1; pent <= i; - j++, pent += 3 * j - 2, sign = -sign) { + j++, pent += 3 * j - 2, sign = -sign) { if (pent + j <= i) sum += dp[i - pent - j] * sign + mod; sum += dp[i - pent] * sign + mod; diff --git a/library/math/prime_sieve/mobius.hpp b/library/math/prime_sieve/mobius.hpp index 00b8e182..433e77bd 100644 --- a/library/math/prime_sieve/mobius.hpp +++ b/library/math/prime_sieve/mobius.hpp @@ -4,4 +4,4 @@ vi mobius(100'005); mobius[1] = 1; rep(i, 1, sz(mobius)) for (int j = i + i; j < sz(mobius); - j += i) mobius[j] -= mobius[i]; + j += i) mobius[j] -= mobius[i]; diff --git a/library/monotonic_stack/cartesian_binary_tree.hpp b/library/monotonic_stack/cartesian_binary_tree.hpp index b9bad14a..67355f4e 100644 --- a/library/monotonic_stack/cartesian_binary_tree.hpp +++ b/library/monotonic_stack/cartesian_binary_tree.hpp @@ -24,7 +24,6 @@ vi cart_binary_tree(const vi& l) { vi p(l); rep(i, 0, sz(p)) for (int j = i - 1; j != l[i]; - j = l[j]) if (l[j] == l[i]) p[j] = - i; + j = l[j]) if (l[j] == l[i]) p[j] = i; return p; } diff --git a/library/monotonic_stack/monotonic_stack.hpp b/library/monotonic_stack/monotonic_stack.hpp index 42615a62..a133d804 100644 --- a/library/monotonic_stack/monotonic_stack.hpp +++ b/library/monotonic_stack/monotonic_stack.hpp @@ -7,10 +7,9 @@ //! a[le[i]] < a[i] //! @time O(n) //! @space O(n) -vi mono_st(const auto& a, auto cmp) { +vi mono_st(const auto& a, const auto& cmp) { vi l(sz(a)); - rep(i, 0, sz(a)) for ( - l[i] = i - 1; l[i] >= 0 && !cmp(a[l[i]], a[i]);) l[i] = - l[l[i]]; + rep(i, 0, sz(a)) for (l[i] = i - 1; + l[i] >= 0 && !cmp(a[l[i]], a[i]);) l[i] = l[l[i]]; return l; } diff --git a/library/strings/suffix_array/find/find_string_bs_fast.hpp b/library/strings/suffix_array/find/find_string_bs_fast.hpp index d2998fbf..1f43f0f3 100644 --- a/library/strings/suffix_array/find/find_string_bs_fast.hpp +++ b/library/strings/suffix_array/find/find_string_bs_fast.hpp @@ -8,7 +8,7 @@ match find_str_fast(const T& t) { int s_l = n, s_len = 0; auto cmp = [&](int i, int) -> bool { if (int lcp_len = s_l == n ? 0 : len_lcp(s_l, i); - lcp_len != s_len) + lcp_len != s_len) return (lcp_len < s_len) ^ (cmp_sufs(s_l, i) < 0); auto [it_s, it_t] = mismatch(i + s_len + all(s), s_len + all(t)); diff --git a/library/strings/suffix_array/suffix_array.hpp b/library/strings/suffix_array/suffix_array.hpp index 34b80a80..8ce1278f 100644 --- a/library/strings/suffix_array/suffix_array.hpp +++ b/library/strings/suffix_array/suffix_array.hpp @@ -62,7 +62,7 @@ auto get_sa(const auto& s, int max_num) { if (sz > 0) sz--; if (sa_inv[i] == 0) continue; for (int j = sa[sa_inv[i] - 1]; - max(i, j) + sz < n && s[i + sz] == s[j + sz];) + max(i, j) + sz < n && s[i + sz] == s[j + sz];) sz++; lcp[sa_inv[i] - 1] = sz; } diff --git a/library/strings/suffix_array/suffix_array_short.hpp b/library/strings/suffix_array/suffix_array_short.hpp index 94ed3382..cb0a7f34 100644 --- a/library/strings/suffix_array/suffix_array_short.hpp +++ b/library/strings/suffix_array/suffix_array_short.hpp @@ -29,7 +29,7 @@ auto sa_short(const auto& s) { if (sz > 0) sz--; if (sa_inv[i] == 0) continue; for (int j = sa[sa_inv[i] - 1]; - max(i, j) + sz < n && s[i + sz] == s[j + sz];) + max(i, j) + sz < n && s[i + sz] == s[j + sz];) sz++; lcp[sa_inv[i] - 1] = sz; } diff --git a/tests/.config/.clang-tidy b/tests/.config/.clang-tidy index e446d1b6..b1126e4b 100644 --- a/tests/.config/.clang-tidy +++ b/tests/.config/.clang-tidy @@ -1,5 +1,6 @@ Checks: > -clang-analyzer-core.UndefinedBinaryOperatorResult, + -clang-analyzer-core.BitwiseShift, bugprone-argument-comment, bugprone-assert-side-effect, bugprone-bad-signal-to-kill-thread, diff --git a/tests/.config/.cppcheck_suppression_list b/tests/.config/.cppcheck_suppression_list index b3abc40b..5cebe8c2 100644 --- a/tests/.config/.cppcheck_suppression_list +++ b/tests/.config/.cppcheck_suppression_list @@ -1,21 +1,13 @@ noExplicitConstructor missingIncludeSystem functionConst -assertWithSideEffect unknownMacro +constParameterReference unusedStructMember:../library/flow/min_cost_max_flow.hpp +unusedStructMember:../library/flow/dinic.hpp:15 unusedStructMember:../library/strings/suffix_array/find/match.hpp:10 -unusedStructMember:../library/trees/tree_lift/tree_lift.hpp:17 -unusedStructMember:../library/trees/ladder_decomposition/linear_kth_par.hpp:17 -unusedStructMember:../library/data_structures/dsu/dsu_bipartite.hpp:9 -unusedStructMember:../library/trees/linear_lca.hpp:15 -unusedScopedObject:../library/trees/centroid_decomp_uncommon/count_paths_per_length.hpp:12 -unusedScopedObject:library_checker_aizu_tests/cd_asserts.hpp:6 -unusedScopedObject:../library/trees/centroid_decomp_uncommon/count_paths_per_node.hpp:14 unusedScopedObject:library_checker_aizu_tests/trees/centroid_path_dist.test.cpp:29 -unusedScopedObject:../library/trees/edge_centroid_decomp_uncommon/count_paths_per_length.hpp:13 unusedScopedObject:library_checker_aizu_tests/trees/edge_cd_lca.test.cpp:20 -unusedScopedObject:library_checker_aizu_tests/trees/edge_cd_reroot_dp.test.cpp:49 unusedScopedObject:library_checker_aizu_tests/trees/cd_jump_on_tree.test.cpp:20 unusedScopedObject:library_checker_aizu_tests/trees/cd_jump_on_tree.test.cpp:58 arrayIndexOutOfBoundsCond:library_checker_aizu_tests/math/linear_prime_sieve.test.cpp:17 @@ -25,6 +17,7 @@ useStlAlgorithm:../library/graphs/strongly_connected_components/add_edges_strong useStlAlgorithm:../library/math/matrix_related/row_reduce.hpp:28 useStlAlgorithm:../library/math/count_paths/count_paths_triangle.hpp:24 useStlAlgorithm:../library/math/matrix_related/xor_basis_unordered_intersection.hpp:10 +useStlAlgorithm:../library/math/matrix_related/xor_basis_unordered.hpp:16 shadowFunction:../kactl/content/graph/BinaryLifting.h:17 unknownMacro:../kactl/content/graph/BinaryLifting.h:18 constParameter:../kactl/content/graph/BinaryLifting.h:29 @@ -36,10 +29,6 @@ constParameter:../library/data_structures/wavelet_merge/merge_sort_tree_updates. constParameter:../library/data_structures/wavelet_merge/wavelet_tree_updates.hpp:49 constParameter:../library/data_structures/wavelet_merge/wavelet_tree_updates.hpp:53 constParameter:../hackpack-cpp/content/number-theory/ModInt.h:45 -constParameter:../library/data_structures/deque_op/deque.hpp:10 -constParameter:../library/data_structures/deque_op/queue_only.hpp:29 -constParameter:../library/data_structures/uncommon/priority_queue_of_updates.hpp:43 -constParameter:../library/math/matrix_related/row_reduce.hpp:17 constParameter:library_checker_aizu_tests/data_structures/rmq_inc.test.cpp:11 variableScope:../kactl/content/number-theory/Factor.h:47 syntaxError:../library/math/n_choose_k/pascals_identity.hpp:4 @@ -51,8 +40,23 @@ syntaxError:../library/loops/submasks.hpp:7 syntaxError:../library/loops/supermasks.hpp:8 syntaxError:../library/math/prime_sieve/mobius.hpp:6 syntaxError:../library/trees/lca_rmq/iterate_subtree.hpp:6 -constVariable:../kactl/content/graph/CompressTree.h:20 knownConditionTrueFalse:../library/strings/suffix_array/suffix_array.hpp:62 knownConditionTrueFalse:../library/strings/suffix_array/suffix_array_short.hpp:29 +knownConditionTrueFalse:../library/data_structures/dsu/kruskal_tree.hpp:15 constVariable:../kactl/content/numerical/NumberTheoreticTransform.h:30 +constVariable:../kactl/content/graph/CompressTree.h:20 functionStatic:../library/monotonic_stack/monotonic_stack.hpp:10 +constVariableReference:../kactl/content/graph/CompressTree.h:20 +constVariableReference:../library/flow/min_cost_max_flow.hpp:43 +constVariableReference:library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp:21 +constVariableReference:library_checker_aizu_tests/handmade_tests/dsu_size.test.cpp:39 +constVariableReference:../library/trees/centroid_decomp_uncommon/count_paths_per_length.hpp:34 +constVariablePointer:../kactl/content/numerical/FastFourierTransform.h:39 +cstyleCast:../kactl/content/numerical/FastFourierTransform.h:39 +derefInvalidIterator:../library/data_structures/uncommon/linear_rmq.hpp:28 +derefInvalidIterator:library_checker_aizu_tests/handmade_tests/n_choose_k.test.cpp:13 +unreadVariable:library_checker_aizu_tests/handmade_tests/permutation_tree_small.test.cpp:12 +uninitvar:library_checker_aizu_tests/handmade_tests/seg_tree_find_small.test.cpp:41 +unusedFunction:../kactl/content/data-structures/UnionFind.h:14 +unusedFunction:../kactl/content/number-theory/ModPow.h:13 +unusedFunction:../kactl/stress-tests/utilities/genTree.h:49 diff --git a/tests/library_checker_aizu_tests/data_structures/line_tree_aizu.test.cpp b/tests/library_checker_aizu_tests/data_structures/line_tree_aizu.test.cpp index e94131bf..d9400ddf 100644 --- a/tests/library_checker_aizu_tests/data_structures/line_tree_aizu.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/line_tree_aizu.test.cpp @@ -29,8 +29,8 @@ int main() { vector edge_weights; vector to_time(n); for (int v = lt.find(0), timer = 1; - lt.edge[v] != pii{-1, -1}; - v = lt.edge[v].first, timer++) { + lt.edge[v] != pii{-1, -1}; + v = lt.edge[v].first, timer++) { edge_weights.push_back(w_eds[lt.edge[v].second][0]); to_time[lt.edge[v].first] = timer; mst_sum += w_eds[lt.edge[v].second][0]; diff --git a/tests/library_checker_aizu_tests/data_structures/line_tree_lib_checker.test.cpp b/tests/library_checker_aizu_tests/data_structures/line_tree_lib_checker.test.cpp index 7a983423..2b6acb51 100644 --- a/tests/library_checker_aizu_tests/data_structures/line_tree_lib_checker.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/line_tree_lib_checker.test.cpp @@ -23,7 +23,7 @@ int main() { int64_t cost = 0; vector ids; for (int v = lt.find(0); lt.edge[v].first != -1; - v = lt.edge[v].first) { + v = lt.edge[v].first) { ids.push_back(w_eds[lt.edge[v].second][0]); cost += weights[w_eds[lt.edge[v].second][0]]; } diff --git a/tests/library_checker_aizu_tests/data_structures/persistent_queue_tree.test.cpp b/tests/library_checker_aizu_tests/data_structures/persistent_queue_tree.test.cpp index 0695c400..321e58e5 100644 --- a/tests/library_checker_aizu_tests/data_structures/persistent_queue_tree.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/persistent_queue_tree.test.cpp @@ -11,7 +11,7 @@ int main() { // bounds[version] = [left index, right index) represents // subarray range of queue for (int curr_version = 1; curr_version <= q; - curr_version++) { + curr_version++) { int type; cin >> type; if (type == 0) { diff --git a/tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp b/tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp index d7fc10ce..05bd7fcd 100644 --- a/tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp @@ -1,10 +1,9 @@ -#define PROBLEM "https://judge.yosupo.jp/problem/incremental_scc" +#define PROBLEM \ + "https://judge.yosupo.jp/problem/incremental_scc" #include "../template.hpp" - #include "../../../library/graphs/strongly_connected_components/offline_incremental_scc.hpp" #include "../../../kactl/content/data-structures/UnionFind.h" #include "../../../library/math/mod_int.hpp" - int main() { cin.tie(0)->sync_with_stdio(0); int n, m; @@ -19,7 +18,8 @@ int main() { assert((eds[t][0] == eds[t][1]) == (joins[t] == -1)); vector order(m); iota(all(order), 0); - ranges::sort(all(order), {}, [&](int i) { return joins[i]; }); + ranges::sort(all(order), {}, + [&](int i) { return joins[i]; }); UF uf(n); mint sum = 0; for (int t = 0, it = 0; t < m; t++) { diff --git a/tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp b/tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp index a919230a..9da0c857 100644 --- a/tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp @@ -1,10 +1,8 @@ #define PROBLEM \ "https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_3_C" #include "../template.hpp" - #include "../../../library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp" #include "../scc_asserts.hpp" - int main() { cin.tie(0)->sync_with_stdio(0); int n, m; diff --git a/tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp b/tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp index 68c3c4db..f4d7dce3 100644 --- a/tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp @@ -1,9 +1,7 @@ #define PROBLEM "https://judge.yosupo.jp/problem/scc" #include "../template.hpp" - #include "../../../library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp" #include "../scc_asserts.hpp" - int main() { cin.tie(0)->sync_with_stdio(0); int n, m; @@ -18,7 +16,8 @@ int main() { auto [num_sccs, scc_id] = sccs(adj); cout << num_sccs << '\n'; vector> each_scc(num_sccs); - for (int i = 0; i < n; i++) each_scc[scc_id[i]].push_back(i); + for (int i = 0; i < n; i++) + each_scc[scc_id[i]].push_back(i); for (int i = num_sccs - 1; i >= 0; i--) { cout << sz(each_scc[i]) << " "; for (auto node : each_scc[i]) cout << node << " "; diff --git a/tests/library_checker_aizu_tests/handmade_tests/dynamic_bitset.test.cpp b/tests/library_checker_aizu_tests/handmade_tests/dynamic_bitset.test.cpp deleted file mode 100644 index f3f1df2f..00000000 --- a/tests/library_checker_aizu_tests/handmade_tests/dynamic_bitset.test.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#define PROBLEM \ - "https://onlinejudge.u-aizu.ac.jp/problems/ITP1_1_A" -#include "../template.hpp" -#include "../../../library/contest/dynamic_bitset.hpp" -int main() { - cin.tie(0)->sync_with_stdio(0); - f(); - cout << "Hello World\n"; - return 0; -} diff --git a/tests/library_checker_aizu_tests/math/xor_basis.test.cpp b/tests/library_checker_aizu_tests/math/xor_basis.test.cpp index a5d1d4b9..d44a43f7 100644 --- a/tests/library_checker_aizu_tests/math/xor_basis.test.cpp +++ b/tests/library_checker_aizu_tests/math/xor_basis.test.cpp @@ -26,7 +26,7 @@ int main() { int64_t val2 = unordered.shrink(val1); assert(val1 == val2); for (int64_t v : unordered.b) - assert(((1LL << __lg(v)) & val2) == 0); + assert((bit_floor((unsigned long long)v) & val2) == 0); bool inserted_unordered = unordered.insert(elem); bool inserted_ordered_ll = ordered_ll.insert(elem); bool inserted_ordered_bitset = @@ -60,7 +60,7 @@ int main() { } for (int i1 = 0; i1 < sz(unordered.b); i1++) { for (int i2 = i1 + 1; i2 < sz(unordered.b); - i2++) { + i2++) { assert(__lg(unordered.b[i1]) != __lg(unordered.b[i2])); assert(((1LL << __lg(unordered.b[i1])) & diff --git a/tests/library_checker_aizu_tests/math/xor_basis_intersection.test.cpp b/tests/library_checker_aizu_tests/math/xor_basis_intersection.test.cpp index 8f88b24a..f93d49c8 100644 --- a/tests/library_checker_aizu_tests/math/xor_basis_intersection.test.cpp +++ b/tests/library_checker_aizu_tests/math/xor_basis_intersection.test.cpp @@ -8,7 +8,7 @@ void check_condition(const basis& b) { int n = sz(b.b); int or_bits = 0; for (int i = n - 1; i >= 0; i--) { - int bit_i = 1 << __lg(b.b[i]); + int bit_i = bit_floor(unsigned(b.b[i])); assert((bit_i & or_bits) == 0); or_bits |= b.b[i]; } diff --git a/tests/library_checker_aizu_tests/strings/prefix_function.test.cpp b/tests/library_checker_aizu_tests/strings/prefix_function.test.cpp index 34bbc4d2..02b05e88 100644 --- a/tests/library_checker_aizu_tests/strings/prefix_function.test.cpp +++ b/tests/library_checker_aizu_tests/strings/prefix_function.test.cpp @@ -17,8 +17,8 @@ int main() { for (int i = 1; i < n;) { int j, v; for (j = 1; - j < z[i] && (v = min(z[j], z[i] - j)) >= z[i + j]; - j++) + j < z[i] && (v = min(z[j], z[i] - j)) >= z[i + j]; + j++) z[i + j] = v; i += j; } diff --git a/tests/scripts/check_format_lint.sh b/tests/scripts/check_format_lint.sh index d9e555b8..fb5a2f82 100755 --- a/tests/scripts/check_format_lint.sh +++ b/tests/scripts/check_format_lint.sh @@ -36,7 +36,7 @@ find ../library/ library_checker_aizu_tests/ -name "*[A-Z]*" -or -name "*-*" | grep --invert-match "README" && exit 1 -clang-format-18 --dry-run --Werror --style=file:.config/.clang-format library_checker_aizu_tests/**/*.hpp ../library/**/*.hpp ../library/**/*.cpp || exit 1 +clang-format-19 --dry-run --Werror --style=file:.config/.clang-format library_checker_aizu_tests/**/*.hpp ../library/**/*.hpp ../library/**/*.cpp || exit 1 git submodule init git submodule update diff --git a/tests/scripts/clangtidy.sh b/tests/scripts/clangtidy.sh index fcde9572..9cc3d610 100755 --- a/tests/scripts/clangtidy.sh +++ b/tests/scripts/clangtidy.sh @@ -9,5 +9,5 @@ git submodule init git submodule update find library_checker_aizu_tests/ -type f -name "*.test.cpp" | - parallel clang-tidy-18 --config-file=.config/.clang-tidy {} -- -std=c++20 || + parallel clang-tidy-19 --config-file=.config/.clang-tidy {} -- -std=c++20 || exit 1 diff --git a/tests/scripts/compile_clang.sh b/tests/scripts/compile_clang.sh index 01c25152..029ddcb5 100755 --- a/tests/scripts/compile_clang.sh +++ b/tests/scripts/compile_clang.sh @@ -9,4 +9,4 @@ git submodule init git submodule update find library_checker_aizu_tests/ -type f -name "*.test.cpp" | - parallel clang++-18 {} "$(tr '\n' ' ' <.config/.clang_compile_flags)" -std=c++20 + parallel clang++-19 {} "$(tr '\n' ' ' <.config/.clang_compile_flags)" -std=c++20 diff --git a/tests/scripts/compile_commented_snippets.sh b/tests/scripts/compile_commented_snippets.sh index 17ba92e5..c451b3fa 100755 --- a/tests/scripts/compile_commented_snippets.sh +++ b/tests/scripts/compile_commented_snippets.sh @@ -11,8 +11,6 @@ git submodule update { echo "#include " echo "using namespace std;" - echo "#include " - echo "using namespace tr2;" cat library_checker_aizu_tests/kactl_macros.hpp echo "const ll mod = (119 << 23) + 1, root = 62;" find ../library/ -type f -name "*.hpp" | grep --invert-match --file=.config/.code_snippet_excluded_file_list | sort | sed 's/^/#include "/; s/$/"/' | cpp -nostdinc -C -P | grep --invert-match --extended-regexp "const int mod = |const ll mod = " @@ -39,4 +37,4 @@ echo "compiling code in @code ... @endcode comments with g++" g++ -std=c++20 entire_library.cpp || exit 1 echo "compiling code in @code ... @endcode comments with clang++" -clang++-18 -std=c++20 entire_library.cpp || exit 1 +clang++-19 -std=c++20 entire_library.cpp || exit 1 diff --git a/tests/scripts/do_format.sh b/tests/scripts/do_format.sh index 1dbcafb8..7a41729a 100755 --- a/tests/scripts/do_format.sh +++ b/tests/scripts/do_format.sh @@ -2,4 +2,4 @@ # ** glob now searches any number of levels shopt -s globstar -clang-format-18 -i --style=file:.config/.clang-format ../**/*.hpp ../**/*.cpp +clang-format-19 -i --style=file:.config/.clang-format ../**/*.hpp ../**/*.cpp