From 8572a246038d7d7d929128151941bd3b02f08e5d Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 2 Apr 2026 14:45:48 -0700 Subject: [PATCH] Cleanup CI config --- .github/workflows/linux.yml | 29 +++++++++-------------------- test/ranges-test.cc | 11 +++++++++-- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6bced99b..f9cca925 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -16,7 +16,6 @@ jobs: shared: [""] include: - cxx: g++-4.9 - - cxx: clang++-3.6 - cxx: g++-11 build_type: Debug std: 14 @@ -37,6 +36,8 @@ jobs: build_type: Release std: 23 install: sudo apt install g++-14 + gen: -G Ninja + - cxx: clang++-3.6 - cxx: clang++-11 build_type: Debug std: 17 @@ -64,6 +65,7 @@ jobs: std: 20 cxxflags: -stdlib=libc++ install: sudo apt install clang-20 libc++-20-dev libc++abi-20-dev + gen: -G Ninja steps: - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 @@ -174,29 +176,16 @@ jobs: CXX: ${{matrix.cxx}} CXXFLAGS: ${{matrix.cxxflags}} ${{matrix.cxxflags_extra}} run: | - cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + cmake ${{matrix.gen}} \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ -DCMAKE_CXX_STANDARD=${{matrix.std}} \ -DCMAKE_CXX_VISIBILITY_PRESET=hidden \ -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \ - -DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON \ - ${{matrix.fuzz}} ${{matrix.shared}} $GITHUB_WORKSPACE - if: ${{ matrix.cxx != 'clang++-20' && matrix.cxx != 'g++-14' }} - - - name: Configure-Modules - working-directory: ${{runner.workspace}}/build - env: - CXX: ${{matrix.cxx}} - CXXFLAGS: ${{matrix.cxxflags}} - run: | - cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ - -DCMAKE_CXX_STANDARD=${{matrix.std}} \ - -DCMAKE_CXX_EXTENSIONS=OFF \ - -G Ninja \ - -DCMAKE_CXX_VISIBILITY_PRESET=hidden \ - -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \ -DFMT_DOC=OFF -DFMT_PEDANTIC=ON \ - ${{matrix.fuzz}} ${{matrix.shared}} $GITHUB_WORKSPACE - if: ${{ matrix.cxx == 'clang++-20' || matrix.cxx == 'g++-14' }} + -DFMT_WERROR=ON \ + ${{matrix.fuzz}} \ + ${{matrix.shared}} \ + $GITHUB_WORKSPACE - name: Build working-directory: ${{runner.workspace}}/build diff --git a/test/ranges-test.cc b/test/ranges-test.cc index 7ec0d76c..0c2d771d 100644 --- a/test/ranges-test.cc +++ b/test/ranges-test.cc @@ -710,10 +710,17 @@ struct codec_mask { int except = 0; }; +// A named functor instead of a lambda to avoid -Wsubobject-linkage: a lambda +// gives the filter_view type internal linkage, which propagates to the +// formatter base class via format_as. +struct not_equal { + int value; + bool operator()(int c) const { return c != value; } +}; + auto format_as(codec_mask mask) { - // Careful not to capture param by reference here, it will dangle. return codec_mask::codecs | - std::views::filter([mask](auto c) { return c != mask.except; }); + std::views::filter(not_equal{mask.except}); } } // namespace views_filter_view_test