Skip to content

Commit

Permalink
fix compatibility with outdated clang versions (#7)
Browse files Browse the repository at this point in the history
* use clang in workflows
  • Loading branch information
Prevter authored Jan 20, 2025
1 parent 64792cc commit 4106d12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,8 @@ jobs:

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

- name: Install GCC 12
run: |
sudo apt install -y gcc-12 g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
- name: Configure CMake
run: cmake -B build -G Ninja
run: cmake -B build -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang

- name: Build
run: cmake --build build --parallel
Expand Down
4 changes: 2 additions & 2 deletions include/Geode/Result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ namespace geode {
/// @param operation the operation to call the Ok value with
/// @return the Result itself
template <class Fn>
requires(!std::same_as<OkType, void> && std::invocable<Fn, OkType const&>)
requires(!std::same_as<OkType, void> && std::invocable<Fn, std::add_lvalue_reference_t<std::add_const_t<OkType>>>)
constexpr Result<OkType, ErrType>& inspect(Fn&& operation
) noexcept(noexcept(operation(std::declval<OkType const&>()))) {
this->inspectInternal(operation);
Expand All @@ -1646,7 +1646,7 @@ namespace geode {
/// @param operation the operation to call the Err value with
/// @return the Result itself
template <class Fn>
requires(!std::same_as<ErrType, void> && std::invocable<Fn, ErrType const&>)
requires(!std::same_as<ErrType, void> && std::invocable<Fn, std::add_lvalue_reference_t<std::add_const_t<ErrType>>>)
constexpr Result<OkType, ErrType>& inspectErr(Fn&& operation
) noexcept(noexcept(operation(std::declval<ErrType const&>()))) {
this->inspectInternalErr(operation);
Expand Down

0 comments on commit 4106d12

Please sign in to comment.