diff --git a/.github/workflows/ci v2.yml b/.github/workflows/ci v2.yml index 70319bfeb..88b09062a 100644 --- a/.github/workflows/ci v2.yml +++ b/.github/workflows/ci v2.yml @@ -84,14 +84,6 @@ jobs: with: fetch-depth: 0 - # Work around https://github.com/actions/runner-images/issues/8659 - # - name: "Remove GCC 13 from runner image (workaround)" - # shell: bash - # run: | - # sudo apt-get update - # sudo apt-get purge -y g++-13 gcc-13 libstdc++-13-dev - # sudo apt-get install -y --allow-downgrades libstdc++-12-dev libstdc++6=12.* libgcc-s1=12.* - - name: Install Qt uses: jurplel/install-qt-action@v4 with: @@ -146,15 +138,6 @@ jobs: with: fetch-depth: 0 - # Work around https://github.com/actions/runner-images/issues/8659 - # - name: "Remove GCC 13 from runner image (workaround)" - # if: matrix.config.os == 'ubuntu-latest' - # shell: bash - # run: | - # sudo apt-get update - # sudo apt-get purge -y g++-13 gcc-13 libstdc++-13-dev - # sudo apt-get install -y --allow-downgrades libstdc++-12-dev libstdc++6=12.* libgcc-s1=12.* - - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -194,7 +177,7 @@ jobs: uses: lukka/run-cmake@v10 with: configurePreset: ${{ matrix.config.name }}-${{ matrix.type }} - configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=${{ matrix.build_type.config }}', '-DCMAKE_CONFIGURATION_TYPES=${{ matrix.build_type.config }}']" + configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=${{ matrix.build_type.config }}', '-DCMAKE_CONFIGURATION_TYPES=${{ matrix.build_type.config }}', '-DRPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION=1']" buildPreset: ci-build buildPresetAdditionalArgs: "['--config ${{ matrix.build_type.config }}']" testPreset: ${{matrix.build_type.test_preset}} diff --git a/src/rpp/rpp/observables/details/disposable_strategy.hpp b/src/rpp/rpp/observables/details/disposable_strategy.hpp index dfcb0cdbb..589dd396a 100644 --- a/src/rpp/rpp/observables/details/disposable_strategy.hpp +++ b/src/rpp/rpp/observables/details/disposable_strategy.hpp @@ -93,9 +93,11 @@ namespace rpp::details::observables template consteval auto* deduce_updated_disposable_strategy() { +#ifndef RPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION if constexpr (has_updated_disposable_strategy) return static_cast*>(nullptr); else +#endif return static_cast(nullptr); } } // namespace details diff --git a/src/rpp/rpp/observers/details/fwd.hpp b/src/rpp/rpp/observers/details/fwd.hpp index 377b9f295..f8fc4ddb9 100644 --- a/src/rpp/rpp/observers/details/fwd.hpp +++ b/src/rpp/rpp/observers/details/fwd.hpp @@ -72,9 +72,11 @@ namespace rpp::details::observers template consteval auto* deduce_disposable_strategy() { +#ifndef RPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION if constexpr (has_disposable_strategy) return static_cast(nullptr); else +#endif return static_cast*>(nullptr); } } // namespace details diff --git a/src/tests/utils/disposable_observable.hpp b/src/tests/utils/disposable_observable.hpp index e5b527b95..023564433 100644 --- a/src/tests/utils/disposable_observable.hpp +++ b/src/tests/utils/disposable_observable.hpp @@ -128,6 +128,7 @@ void test_operator_over_observable_with_disposable(auto&& op) op(rpp::source::create([](auto&& obs) { const auto d = rpp::composite_disposable_wrapper::make(); obs.set_upstream(d); + CHECK(!d.is_disposed()); obs.on_completed(); CHECK(d.is_disposed()); })).subscribe([](const auto&) {}, [](const std::exception_ptr&) {});