add fix to prevent GCC compilation crashing

This commit is contained in:
2026-06-05 09:44:52 +03:00
parent d39a22fd82
commit abb2a691f3
2 changed files with 23 additions and 9 deletions

View File

@@ -450,18 +450,26 @@ public:
std::error_code ec{};
std::string output_buffer;
// #ifdef __GNUG__
// #if __GNUG__ < 16
// auto write_rec = [&output_buffer, &ec, obj_ptr = this]<size_t I = 0>(this auto& self) -> void {
// #else
#ifdef __GNUG__
// to fix GCC compilation crash for the versions < 16
#if GCC_VERSION < 160000
auto write_rec = [&output_buffer, &ec, obj_ptr = this]<size_t I = 0>(this auto& self) -> void {
#else
auto write_rec = [&output_buffer, &ec, this]<size_t I = 0>(this auto& self) -> void {
// #endif
// #endif
#endif
#endif
if constexpr (I < NUMBER_OF_RECORDS) {
// add an empty string within records
std::format_to(std::back_inserter(output_buffer), "{}", DEFAULT_RECORD_DELIMITER);
#ifdef __GNUG__
// to fix GCC compilation crash for the versions < 16
#if GCC_VERSION < 160000
ec = obj_ptr->template formatRecord<I>(output_buffer, DEFAULT_RECORD_DELIMITER, true);
#else
ec = formatRecord<I>(output_buffer, DEFAULT_RECORD_DELIMITER, true);
#endif
#endif
if (ec) {
return;
}