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 0643e4d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,39 @@ jobs:
strategy:
fail-fast: false
matrix:
compiler: [g++-10, clang++-14]
compiler: [g++-8, g++-10, clang++-14]
target: [Debug]
steps:
- uses: actions/checkout@v2
- name: dependencies
run: |
sudo apt install gcc-10 g++-10 libgcc-10-dev
sudo apt install gcc-10 g++-10 libgcc-10-dev g++-8
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-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: |
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 0643e4d

Please sign in to comment.