From 5984bc520478d6f51fab79de3477fb690ab74ccd Mon Sep 17 00:00:00 2001 From: "Timur A. Fatkhullin" Date: Fri, 5 Jun 2026 09:44:30 +0300 Subject: [PATCH] mcc_keyvalue.h: add fix to prevent GCC compilation crashing --- include/mcc/mcc_keyvalue.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/mcc/mcc_keyvalue.h b/include/mcc/mcc_keyvalue.h index aa5384c..7e765a2 100644 --- a/include/mcc/mcc_keyvalue.h +++ b/include/mcc/mcc_keyvalue.h @@ -411,16 +411,38 @@ public: std::error_code ec{}; +#ifdef __GNUG__ +// to fix GCC compilation crash for the versions < 16 +#if GCC_VERSION < 160000 + auto write_rec = [&output_buffer, &rec_delim, &ec, obj_ptr = this](this auto& self) -> void { +#else auto write_rec = [&output_buffer, &rec_delim, &ec, this](this auto& self) -> void { +#endif +#endif if constexpr (I < NUMBER_OF_RECORDS) { if constexpr (OPOLICY == MccKeyValueHolder::OPOLICY_CHANGED_ONLY) { +#ifdef __GNUG__ +// to fix GCC compilation crash for the versions < 16 +#if GCC_VERSION < 160000 + if (obj_ptr->_changedKey.count(obj_ptr->_hashes[I]) == 0) { +#else if (_changedKey.count(_hashes[I]) == 0) { +#endif +#endif self.template operator()(); return; } } ec = formatRecord(output_buffer, rec_delim); +#ifdef __GNUG__ +// to fix GCC compilation crash for the versions < 16 +#if GCC_VERSION < 160000 + ec = obj_ptr->template formatRecord(output_buffer, rec_delim); +#else + ec = formatRecord(output_buffer, rec_delim); +#endif +#endif if (ec) { return; }