From 277757befc321bda3b9d8038ee59ae6e4616cdca Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 16 Dec 2021 06:18:06 +0200 Subject: [PATCH] Disable -Wmaybe-uninitialized in function_template.hpp for GCC 11 --- include/boost/function/function_template.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 26f1d67..f62c494 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -1010,8 +1010,16 @@ namespace boost { # pragma GCC diagnostic pop # endif } else +#if defined(BOOST_GCC) && (__GNUC__ == 11) +# pragma GCC diagnostic push +// False positive in GCC 11 for empty function objects (function_n_test.cpp:673) +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif get_vtable()->base.manager(f.functor, this->functor, boost::detail::function::move_functor_tag); +#if defined(BOOST_GCC) && (__GNUC__ == 11) +# pragma GCC diagnostic pop +#endif f.vtable = 0; } else { clear();