diff --git a/tf_idf_actrie/actrie.hpp b/tf_idf_actrie/actrie.hpp index fb6a979..bd2d9ee 100644 --- a/tf_idf_actrie/actrie.hpp +++ b/tf_idf_actrie/actrie.hpp @@ -715,7 +715,16 @@ class [[nodiscard]] ReplacingACTrieBuilder final bool AddPatternWithReplacement(std::string_view pattern, std::string replacement) { bool added = Base::AddPattern(pattern); if (added) { +#if defined(__GNUG__) && __GNUG__ == 14 && !defined(__clang__) +// Bug in GCC 14: false positive may occur with +// warning -Walloc-size-larger-than=x if x < 9223372036854775776 +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wno-alloc-size-larger-than" +#endif words_replacements_.push_back(std::move(replacement)); +#if defined(__GNUG__) && __GNUG__ == 14 && !defined(__clang__) +#pragma GCC diagnostic pop +#endif } return added; }