From 9e6d3de3e972ab598aa221198f8abf337e38132c Mon Sep 17 00:00:00 2001 From: Dmitry Arkhipov Date: Tue, 10 Sep 2024 11:29:13 +0300 Subject: [PATCH] silence GCC false positives in tests --- include/boost/json/detail/value_to.hpp | 7 +++++++ test/Jamfile | 1 + 2 files changed, 8 insertions(+) diff --git a/include/boost/json/detail/value_to.hpp b/include/boost/json/detail/value_to.hpp index 18f48b923..0f95cdff0 100644 --- a/include/boost/json/detail/value_to.hpp +++ b/include/boost/json/detail/value_to.hpp @@ -304,8 +304,15 @@ try_make_tuple_like( typename std::decay>::type >( arr[Is], ctx, ec) ...); +#if defined(BOOST_GCC) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif if( ec.failed() ) return {boost::system::in_place_error, ec}; +#if defined(BOOST_GCC) +# pragma GCC diagnostic pop +#endif return { boost::system::in_place_value, T(std::move(*std::get(items))...)}; diff --git a/test/Jamfile b/test/Jamfile index b9bf751ed..e8d3b33a3 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -63,6 +63,7 @@ project . msvc:_SCL_SECURE_NO_WARNINGS msvc:_CRT_SECURE_NO_WARNINGS + gcc:-Wno-restrict # annoying false positives ; for local f in $(SOURCES)