Skip to content

Commit 4106d12

Browse files
authored
fix compatibility with outdated clang versions (#7)
* use clang in workflows
1 parent 64792cc commit 4106d12

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,8 @@ jobs:
1515

1616
- uses: seanmiddleditch/gha-setup-ninja@v4
1717

18-
- name: Install GCC 12
19-
run: |
20-
sudo apt install -y gcc-12 g++-12
21-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100
22-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
23-
2418
- name: Configure CMake
25-
run: cmake -B build -G Ninja
19+
run: cmake -B build -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
2620

2721
- name: Build
2822
run: cmake --build build --parallel

include/Geode/Result.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,7 @@ namespace geode {
16351635
/// @param operation the operation to call the Ok value with
16361636
/// @return the Result itself
16371637
template <class Fn>
1638-
requires(!std::same_as<OkType, void> && std::invocable<Fn, OkType const&>)
1638+
requires(!std::same_as<OkType, void> && std::invocable<Fn, std::add_lvalue_reference_t<std::add_const_t<OkType>>>)
16391639
constexpr Result<OkType, ErrType>& inspect(Fn&& operation
16401640
) noexcept(noexcept(operation(std::declval<OkType const&>()))) {
16411641
this->inspectInternal(operation);
@@ -1646,7 +1646,7 @@ namespace geode {
16461646
/// @param operation the operation to call the Err value with
16471647
/// @return the Result itself
16481648
template <class Fn>
1649-
requires(!std::same_as<ErrType, void> && std::invocable<Fn, ErrType const&>)
1649+
requires(!std::same_as<ErrType, void> && std::invocable<Fn, std::add_lvalue_reference_t<std::add_const_t<ErrType>>>)
16501650
constexpr Result<OkType, ErrType>& inspectErr(Fn&& operation
16511651
) noexcept(noexcept(operation(std::declval<ErrType const&>()))) {
16521652
this->inspectInternalErr(operation);

0 commit comments

Comments
 (0)