Skip to content

Commit

Permalink
Revert "Undo gcc-8 exploration"
Browse files Browse the repository at this point in the history
This reverts commit 426cd60.
  • Loading branch information
jeremy-rifkin committed Jun 1, 2024
1 parent 55e9d1e commit 86546b8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@ jobs:
working-directory: build
run: |
CTEST_OUTPUT_ON_FAILURE=1 make test
test-linux-gcc-8:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
compiler: [g++-8]
target: [Debug]
steps:
- uses: actions/checkout@v2
- name: dependencies
run: |
sudo apt install gcc-8 g++-8 libgcc-8-dev
python3 -m pip install git+https://github.com/jeffkaufman/icdiff.git
- name: build
run: |
mkdir -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{matrix.target}} \
-DCMAKE_CXX_COMPILER=${{matrix.compiler}} \
-DLIBASSERT_BUILD_TESTING=On
make -j
- name: test
working-directory: build
run: |
CTEST_OUTPUT_ON_FAILURE=1 make test
test-macos:
runs-on: macos-14
strategy:
Expand Down
13 changes: 6 additions & 7 deletions src/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,14 @@ namespace libassert::detail {
}
};

// copied from cppref
template<typename T, std::size_t N, std::size_t... I>
constexpr std::array<std::remove_cv_t<T>, N> to_array_impl(T(&&a)[N], std::index_sequence<I...>) {
// note: the use of U here is mainly to workaround a gcc 8 issue https://godbolt.org/z/bdsWhdGj3
template<typename T, typename U, std::size_t N, std::size_t... I>
constexpr std::array<std::remove_cv_t<T>, N> to_array_impl(U(&&a)[N], std::index_sequence<I...>) {
return {{std::move(a[I])...}};
}

template<typename T, std::size_t N>
constexpr std::array<std::remove_cv_t<T>, N> to_array(T(&&a)[N]) {
return to_array_impl(std::move(a), std::make_index_sequence<N>{});
template<typename T, typename U, std::size_t N>
constexpr std::array<std::remove_cv_t<T>, N> to_array(U(&&a)[N]) {
return to_array_impl<T>(std::move(a), std::make_index_sequence<N>{});
}

template<typename A, typename B>
Expand Down

0 comments on commit 86546b8

Please sign in to comment.