Skip to content

Commit

Permalink
Merge pull request #220 from tcbrindle/pr/drop-gcc11
Browse files Browse the repository at this point in the history
Drop GCC 11
  • Loading branch information
tcbrindle authored Nov 26, 2024
2 parents 5854e37 + ee9a8a8 commit 82c7555
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 45 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [GCC-11, GCC-12, GCC-13, GCC-14, Clang-17, Clang-18, Clang-19]
compiler: [GCC-12, GCC-13, GCC-14, Clang-17, Clang-18, Clang-19]
test_with: [Headers, Module]
build_type: [Debug, Release]

exclude:
- compiler: GCC-11
test_with: Module
- compiler: GCC-12
test_with: Module
- compiler: GCC-13
Expand All @@ -26,11 +24,6 @@ jobs:
test_with: Module

include:
- compiler: GCC-11
cxx: g++-11
install: |
brew install gcc@11 ninja binutils
brew link --force binutils
- compiler: GCC-12
cxx: g++-12
install: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ See the vcpkg documentation for more details.

Flux requires a recent compiler with good support for the C++20 standard. It is tested with:

* GCC 11.3 and newer
* GCC 12 and newer
* LLVM Clang 16 and newer
* MSVC 2022
* AppleClang/Xcode 16
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Algorithms
:language: cpp
:linenos:
:dedent:
:lines: 21-52
:lines: 16-44

:see also:
* `std::lexicographical_compare_three_way() <https://en.cppreference.com/w/cpp/algorithm/lexicographical_compare_three_way>`_
Expand Down
8 changes: 0 additions & 8 deletions example/docs/compare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
#include <limits>
#include <vector>

#ifdef _GLIBCXX_RELEASE
#if _GLIBCXX_RELEASE < 12
#define COMPILER_IS_GCC11
#endif
#endif

int main()
{
Expand Down Expand Up @@ -43,11 +38,8 @@ int main()

// On most systems we can use std::strong_order as a custom comparator
// to get a total order for IEEE floats
// (Note that this is not supported with GCC 11)
#ifndef COMPILER_IS_GCC11
if constexpr (std::numeric_limits<double>::is_iec559) {
assert(flux::compare(v5, v6, std::strong_order) ==
std::strong_ordering::less);
}
#endif
}
25 changes: 1 addition & 24 deletions example/top10/07_max_gap_count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@

#include <flux.hpp>

// GCC 11 doesn't support constexpr std::vector
#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 12
#define COMPILER_IS_GCC11
#endif

// std::abs is not constexpr in C++20
auto const c_abs = [](std::signed_integral auto i) { return i < 0 ? -i : i; };

Expand All @@ -31,11 +26,9 @@ auto const max_gap_count = [](std::vector<int> nums)
return diffs.count_eq(diffs.max().value_or(0));
};

#ifndef COMPILER_IS_GCC11
static_assert(max_gap_count({2, 5, 8, 1}) == 2);
static_assert(max_gap_count({3, 6, 9, 1}) == 2);
static_assert(max_gap_count({10}) == 0);
#endif

}

Expand Down Expand Up @@ -63,27 +56,11 @@ auto const max_gap_count = [](std::vector<int> nums)
.count;
};

#ifndef COMPILER_IS_GCC11
static_assert(max_gap_count({2, 5, 8, 1}) == 2);
static_assert(max_gap_count({3, 6, 9, 1}) == 2);
static_assert(max_gap_count({10}) == 0);
#endif

}

int main()
{
{
using namespace version1;
FLUX_ASSERT(max_gap_count({2, 5, 8, 1}) == 2);
FLUX_ASSERT(max_gap_count({3, 6, 9, 1}) == 2);
FLUX_ASSERT(max_gap_count({10}) == 0);
}

{
using namespace version2;
FLUX_ASSERT(max_gap_count({2, 5, 8, 1}) == 2);
FLUX_ASSERT(max_gap_count({3, 6, 9, 1}) == 2);
FLUX_ASSERT(max_gap_count({10}) == 0);
}
}
{}
2 changes: 1 addition & 1 deletion include/flux/core/concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// clang-format off

// Workaround GCC11/12 ICE in sequence concept definition below
// Workaround GCC12 ICE in sequence concept definition below
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 13)
#define FLUX_COMPILER_IS_GCC12
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_optional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

namespace {

// GCC11 std::string isn't usable in constexpr, so here's a quick and dirty
// version instead
// Constexpr use of std::string causes problems with some compiler/stdlib
// combinations, so here's a quick-and-dirty constexpr string instead
struct String {
private:
using Traits = std::char_traits<char>;
Expand Down

0 comments on commit 82c7555

Please sign in to comment.