diff --git a/CHANGELOG.md b/CHANGELOG.md index 648b2794..a3d74544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Version 81: * Pass string_view by value * better is_final on empty_base_optimization +* Suppress incorrect GCC warning -------------------------------------------------------------------------------- diff --git a/include/beast/zlib/detail/deflate_stream.hpp b/include/beast/zlib/detail/deflate_stream.hpp index b51baff1..e0574c98 100644 --- a/include/beast/zlib/detail/deflate_stream.hpp +++ b/include/beast/zlib/detail/deflate_stream.hpp @@ -1040,7 +1040,10 @@ doWrite(z_params& zs, boost::optional flush, error_code& ec) } // value of flush param for previous deflate call - boost::optional old_flush = last_flush_; + auto old_flush = boost::make_optional( + last_flush_.is_initialized(), + last_flush_ ? *last_flush_ : Flush::none); + last_flush_ = flush; // Flush as much pending output as possible