Skip to content

Commit 19369a5

Browse files
authored
Merge pull request #213 from elbeno/add-clang-20
👷 Add clang-20 support
2 parents 01be679 + b254151 commit 19369a5

File tree

4 files changed

+39
-28
lines changed

4 files changed

+39
-28
lines changed

.github/workflows/unit_tests.yml

+21-10
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ env:
1313
DEBIAN_FRONTEND: noninteractive
1414
CMAKE_GENERATOR: Ninja
1515
DEFAULT_CXX_STANDARD: 20
16-
DEFAULT_LLVM_VERSION: 19
16+
DEFAULT_LLVM_VERSION: 20
1717
DEFAULT_GCC_VERSION: 13
18-
MULL_LLVM_VERSION: 17
18+
MULL_LLVM_VERSION: 18
19+
MULL_VERSION: 0.24.0
1920
HYPOTHESIS_PROFILE: default
2021

2122
concurrency:
@@ -29,7 +30,7 @@ jobs:
2930
fail-fast: false
3031
matrix:
3132
compiler: [clang, gcc]
32-
version: [12, 13, 16, 17, 18, 19]
33+
version: [12, 13, 16, 17, 18, 19, 20]
3334
cxx_standard: [17, 20]
3435
stdlib: [libstdc++, libc++]
3536
build_type: [Debug]
@@ -38,6 +39,15 @@ jobs:
3839
cc: "clang"
3940
cxx: "clang++"
4041
cxx_flags: "-stdlib=libstdc++"
42+
- version: 20
43+
compiler: clang
44+
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 20
45+
toolchain_root: "/usr/lib/llvm-20"
46+
- version: 20
47+
compiler: clang
48+
stdlib: libc++
49+
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 20 && sudo apt install -y libc++-20-dev libc++abi-20-dev
50+
cxx_flags: "-stdlib=libc++"
4151
- version: 19
4252
compiler: clang
4353
install: sudo apt update && sudo apt install -y clang-19
@@ -89,6 +99,8 @@ jobs:
8999
cxx: "g++-12"
90100
cxx_flags: ""
91101
exclude:
102+
- compiler: gcc
103+
version: 20
92104
- compiler: gcc
93105
version: 19
94106
- compiler: gcc
@@ -255,7 +267,8 @@ jobs:
255267

256268
- name: Install build tools
257269
run: |
258-
sudo apt update && sudo apt install -y pipx ninja-build clang-tidy-${{env.DEFAULT_LLVM_VERSION}} clang-format-${{env.DEFAULT_LLVM_VERSION}}
270+
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh ${{env.DEFAULT_LLVM_VERSION}}
271+
sudo apt install -y pipx ninja-build clang-tidy-${{env.DEFAULT_LLVM_VERSION}} clang-format-${{env.DEFAULT_LLVM_VERSION}}
259272
260273
- name: Install cmake-format
261274
run: |
@@ -304,8 +317,8 @@ jobs:
304317
- compiler: clang
305318
cc: "clang"
306319
cxx: "clang++"
307-
install: sudo apt update && sudo apt install -y clang-19
308-
toolchain_root: "/usr/lib/llvm-19"
320+
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 20
321+
toolchain_root: "/usr/lib/llvm-20"
309322
- compiler: gcc
310323
cc: "gcc-13"
311324
cxx: "g++-13"
@@ -452,11 +465,9 @@ jobs:
452465
sudo apt update && sudo apt install -y clang-${{env.MULL_LLVM_VERSION}} ninja-build python3-venv python3-pip
453466
454467
- name: Install mull
455-
env:
456-
MULL_VERSION: 0.23.0
457468
run: |
458-
wget https://github.com/mull-project/mull/releases/download/${{env.MULL_VERSION}}/Mull-${{env.MULL_LLVM_VERSION}}-${{env.MULL_VERSION}}-LLVM-${{env.MULL_LLVM_VERSION}}.0-ubuntu-24.04.deb
459-
sudo dpkg -i Mull-${{env.MULL_LLVM_VERSION}}-${{env.MULL_VERSION}}-LLVM-${{env.MULL_LLVM_VERSION}}.0-ubuntu-24.04.deb
469+
wget https://github.com/mull-project/mull/releases/download/${{env.MULL_VERSION}}/Mull-${{env.MULL_LLVM_VERSION}}-${{env.MULL_VERSION}}-LLVM-${{env.MULL_LLVM_VERSION}}.1-ubuntu-24.04.deb
470+
sudo dpkg -i Mull-${{env.MULL_LLVM_VERSION}}-${{env.MULL_VERSION}}-LLVM-${{env.MULL_LLVM_VERSION}}.1-ubuntu-24.04.deb
460471
461472
- name: Restore CPM cache
462473
env:

include/stdx/atomic_bitset.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class atomic_bitset {
4242
return atomic::load(storage, order) & mask;
4343
}
4444

45-
[[nodiscard]] static constexpr auto value_from_string(std::string_view str,
45+
[[nodiscard]] constexpr static auto value_from_string(std::string_view str,
4646
std::size_t pos,
4747
std::size_t n,
4848
char one) -> elem_t {

include/stdx/byterator.hpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ template <typename T> class byterator {
3434
using byte_t = std::remove_reference_t<forward_like_t<T, std::byte>>;
3535
byte_t *ptr;
3636

37-
[[nodiscard]] constexpr friend auto operator==(byterator const &x,
37+
[[nodiscard]] friend constexpr auto operator==(byterator const &x,
3838
byterator const &y) -> bool {
3939
return x.ptr == y.ptr;
4040
}
4141

4242
template <typename It,
4343
std::enable_if_t<std::is_same_v<detail::iterator_value_t<It>, T>,
4444
int> = 0>
45-
[[nodiscard]] constexpr friend auto operator==(byterator const &x, It y)
45+
[[nodiscard]] friend constexpr auto operator==(byterator const &x, It y)
4646
-> bool {
4747
return static_cast<void const *>(x.ptr) ==
4848
static_cast<void const *>(stdx::to_address(y));
@@ -60,34 +60,34 @@ template <typename T> class byterator {
6060
}
6161

6262
template <typename It>
63-
[[nodiscard]] constexpr friend auto operator==(It y, byterator const &x)
63+
[[nodiscard]] friend constexpr auto operator==(It y, byterator const &x)
6464
-> bool {
6565
return x == y;
6666
}
6767
template <typename It>
68-
[[nodiscard]] constexpr friend auto operator!=(byterator const &x, It y)
68+
[[nodiscard]] friend constexpr auto operator!=(byterator const &x, It y)
6969
-> bool {
7070
return not(x == y);
7171
}
7272
template <typename It>
73-
[[nodiscard]] constexpr friend auto operator!=(It y, byterator const &x)
73+
[[nodiscard]] friend constexpr auto operator!=(It y, byterator const &x)
7474
-> bool {
7575
return not(x == y);
7676
}
7777

78-
[[nodiscard]] constexpr friend auto operator<(byterator const &x,
78+
[[nodiscard]] friend constexpr auto operator<(byterator const &x,
7979
byterator const &y) -> bool {
8080
return std::less{}(x.ptr, y.ptr);
8181
}
82-
[[nodiscard]] constexpr friend auto operator<=(byterator const &x,
82+
[[nodiscard]] friend constexpr auto operator<=(byterator const &x,
8383
byterator const &y) -> bool {
8484
return std::less_equal{}(x.ptr, y.ptr);
8585
}
86-
[[nodiscard]] constexpr friend auto operator>(byterator const &x,
86+
[[nodiscard]] friend constexpr auto operator>(byterator const &x,
8787
byterator const &y) -> bool {
8888
return std::greater{}(x.ptr, y.ptr);
8989
}
90-
[[nodiscard]] constexpr friend auto operator>=(byterator const &x,
90+
[[nodiscard]] friend constexpr auto operator>=(byterator const &x,
9191
byterator const &y) -> bool {
9292
return std::greater_equal{}(x.ptr, y.ptr);
9393
}

include/stdx/rollover.hpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ template <typename T> struct rollover_t {
6666
}
6767

6868
private:
69-
[[nodiscard]] constexpr friend auto operator==(rollover_t lhs,
69+
[[nodiscard]] friend constexpr auto operator==(rollover_t lhs,
7070
rollover_t rhs) -> bool {
7171
return lhs.value == rhs.value;
7272
}
73-
[[nodiscard]] constexpr friend auto operator!=(rollover_t lhs,
73+
[[nodiscard]] friend constexpr auto operator!=(rollover_t lhs,
7474
rollover_t rhs) -> bool {
7575
return not(lhs == rhs);
7676
}
@@ -80,37 +80,37 @@ template <typename T> struct rollover_t {
8080
friend constexpr auto operator>(rollover_t, rollover_t) -> bool = delete;
8181
friend constexpr auto operator>=(rollover_t, rollover_t) -> bool = delete;
8282

83-
[[nodiscard]] constexpr friend auto cmp_less(rollover_t lhs, rollover_t rhs)
83+
[[nodiscard]] friend constexpr auto cmp_less(rollover_t lhs, rollover_t rhs)
8484
-> bool {
8585
constexpr auto mid = static_cast<underlying_t>(~underlying_t{}) / 2;
8686
return static_cast<underlying_t>(lhs.value - rhs.value) > mid;
8787
}
8888

89-
[[nodiscard]] constexpr friend auto operator+(rollover_t lhs,
89+
[[nodiscard]] friend constexpr auto operator+(rollover_t lhs,
9090
rollover_t rhs)
9191
-> rollover_t {
9292
lhs += rhs;
9393
return lhs;
9494
}
95-
[[nodiscard]] constexpr friend auto operator-(rollover_t lhs,
95+
[[nodiscard]] friend constexpr auto operator-(rollover_t lhs,
9696
rollover_t rhs)
9797
-> rollover_t {
9898
lhs -= rhs;
9999
return lhs;
100100
}
101-
[[nodiscard]] constexpr friend auto operator*(rollover_t lhs,
101+
[[nodiscard]] friend constexpr auto operator*(rollover_t lhs,
102102
rollover_t rhs)
103103
-> rollover_t {
104104
lhs *= rhs;
105105
return lhs;
106106
}
107-
[[nodiscard]] constexpr friend auto operator/(rollover_t lhs,
107+
[[nodiscard]] friend constexpr auto operator/(rollover_t lhs,
108108
rollover_t rhs)
109109
-> rollover_t {
110110
lhs /= rhs;
111111
return lhs;
112112
}
113-
[[nodiscard]] constexpr friend auto operator%(rollover_t lhs,
113+
[[nodiscard]] friend constexpr auto operator%(rollover_t lhs,
114114
rollover_t rhs)
115115
-> rollover_t {
116116
lhs %= rhs;

0 commit comments

Comments
 (0)