Remove some Wmaybe-uninitialized warnings for GCC 11

This commit is contained in:
Ion Gaztañaga
2021-12-29 23:43:44 +01:00
parent 6e2032717c
commit 4301005b25
2 changed files with 24 additions and 24 deletions

View File

@@ -131,8 +131,8 @@ struct insert_value_initialized_n_proxy
while (n){ while (n){
--n; --n;
storage_t v; storage_t v;
value_type *vp = move_detail::force_ptr<value_type *>(static_cast<void *>(v.data)); alloc_traits::construct(a, move_detail::force_ptr<value_type *>(&v));
alloc_traits::construct(a, vp); value_type *vp = move_detail::force_ptr<value_type *>(&v);
value_destructor<Allocator> on_exit(a, *vp); (void)on_exit; value_destructor<Allocator> on_exit(a, *vp); (void)on_exit;
*p = ::boost::move(*vp); *p = ::boost::move(*vp);
++p; ++p;
@@ -156,8 +156,8 @@ struct insert_default_initialized_n_proxy
while (n){ while (n){
--n; --n;
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v; typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
value_type *vp = move_detail::force_ptr<value_type *>(v.data); alloc_traits::construct(a, move_detail::force_ptr<value_type *>(&v), default_init);
alloc_traits::construct(a, vp, default_init); value_type *vp = move_detail::force_ptr<value_type *>(&v);
value_destructor<Allocator> on_exit(a, *vp); (void)on_exit; value_destructor<Allocator> on_exit(a, *vp); (void)on_exit;
*p = ::boost::move(*vp); *p = ::boost::move(*vp);
++p; ++p;
@@ -297,8 +297,8 @@ struct insert_emplace_proxy
{ {
BOOST_ASSERT(n ==1); (void)n; BOOST_ASSERT(n ==1); (void)n;
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v; typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
value_type *vp = move_detail::force_ptr<value_type *>(v.data); alloc_traits::construct(a, move_detail::force_ptr<value_type *>(&v), ::boost::forward<Args>(get<IdxPack>(this->args_))...);
alloc_traits::construct(a, vp, ::boost::forward<Args>(get<IdxPack>(this->args_))...); value_type *vp = move_detail::force_ptr<value_type *>(&v);
BOOST_TRY{ BOOST_TRY{
*p = ::boost::move(*vp); *p = ::boost::move(*vp);
} }
@@ -417,8 +417,8 @@ struct insert_emplace_proxy_arg##N\
{\ {\
BOOST_ASSERT(n == 1); (void)n;\ BOOST_ASSERT(n == 1); (void)n;\
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\ typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
value_type *vp = move_detail::force_ptr<value_type *>(v.data);\ alloc_traits::construct(a, move_detail::force_ptr<value_type *>(&v) BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\
alloc_traits::construct(a, vp BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\ value_type *vp = move_detail::force_ptr<value_type *>(&v);\
BOOST_TRY{\ BOOST_TRY{\
*p = ::boost::move(*vp);\ *p = ::boost::move(*vp);\
}\ }\

View File

@@ -961,9 +961,9 @@ class flat_tree
std::pair<iterator, bool> emplace_unique(BOOST_FWD_REF(Args)... args) std::pair<iterator, bool> emplace_unique(BOOST_FWD_REF(Args)... args)
{ {
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v; typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
value_type *pval = move_detail::force_ptr<value_type *>(v.data);
get_stored_allocator_noconst_return_t a = this->get_stored_allocator(); get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
stored_allocator_traits::construct(a, pval, ::boost::forward<Args>(args)... ); stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v), ::boost::forward<Args>(args)... );
value_type *pval = move_detail::force_ptr<value_type *>(&v);
value_destructor<stored_allocator_type, value_type> d(a, *pval); value_destructor<stored_allocator_type, value_type> d(a, *pval);
return this->insert_unique(::boost::move(*pval)); return this->insert_unique(::boost::move(*pval));
} }
@@ -973,9 +973,9 @@ class flat_tree
{ {
//hint checked in insert_unique //hint checked in insert_unique
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v; typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
value_type *pval = move_detail::force_ptr<value_type *>(v.data);
get_stored_allocator_noconst_return_t a = this->get_stored_allocator(); get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
stored_allocator_traits::construct(a, pval, ::boost::forward<Args>(args)... ); stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v), ::boost::forward<Args>(args)... );
value_type *pval = move_detail::force_ptr<value_type *>(&v);
value_destructor<stored_allocator_type, value_type> d(a, *pval); value_destructor<stored_allocator_type, value_type> d(a, *pval);
return this->insert_unique(hint, ::boost::move(*pval)); return this->insert_unique(hint, ::boost::move(*pval));
} }
@@ -984,9 +984,9 @@ class flat_tree
iterator emplace_equal(BOOST_FWD_REF(Args)... args) iterator emplace_equal(BOOST_FWD_REF(Args)... args)
{ {
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v; typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
value_type *pval = move_detail::force_ptr<value_type *>(v.data);
get_stored_allocator_noconst_return_t a = this->get_stored_allocator(); get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
stored_allocator_traits::construct(a, pval, ::boost::forward<Args>(args)... ); stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v), ::boost::forward<Args>(args)... );
value_type *pval = move_detail::force_ptr<value_type *>(&v);
value_destructor<stored_allocator_type, value_type> d(a, *pval); value_destructor<stored_allocator_type, value_type> d(a, *pval);
return this->insert_equal(::boost::move(*pval)); return this->insert_equal(::boost::move(*pval));
} }
@@ -996,9 +996,9 @@ class flat_tree
{ {
//hint checked in insert_equal //hint checked in insert_equal
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v; typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
value_type *pval = move_detail::force_ptr<value_type *>(v.data);
get_stored_allocator_noconst_return_t a = this->get_stored_allocator(); get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
stored_allocator_traits::construct(a, pval, ::boost::forward<Args>(args)... ); stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v), ::boost::forward<Args>(args)... );
value_type *pval = move_detail::force_ptr<value_type *>(&v);
value_destructor<stored_allocator_type, value_type> d(a, *pval); value_destructor<stored_allocator_type, value_type> d(a, *pval);
return this->insert_equal(hint, ::boost::move(*pval)); return this->insert_equal(hint, ::boost::move(*pval));
} }
@@ -1030,9 +1030,9 @@ class flat_tree
std::pair<iterator, bool> emplace_unique(BOOST_MOVE_UREF##N)\ std::pair<iterator, bool> emplace_unique(BOOST_MOVE_UREF##N)\
{\ {\
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\ typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
value_type *pval = move_detail::force_ptr<value_type *>(v.data);\
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\ get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
stored_allocator_traits::construct(a, pval BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\ stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
value_type *pval = move_detail::force_ptr<value_type *>(&v);\
value_destructor<stored_allocator_type, value_type> d(a, *pval);\ value_destructor<stored_allocator_type, value_type> d(a, *pval);\
return this->insert_unique(::boost::move(*pval));\ return this->insert_unique(::boost::move(*pval));\
}\ }\
@@ -1041,9 +1041,9 @@ class flat_tree
iterator emplace_hint_unique(const_iterator hint BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ iterator emplace_hint_unique(const_iterator hint BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\ {\
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\ typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
value_type *pval = move_detail::force_ptr<value_type *>(v.data);\
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\ get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
stored_allocator_traits::construct(a, pval BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\ stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
value_type *pval = move_detail::force_ptr<value_type *>(&v);\
value_destructor<stored_allocator_type, value_type> d(a, *pval);\ value_destructor<stored_allocator_type, value_type> d(a, *pval);\
return this->insert_unique(hint, ::boost::move(*pval));\ return this->insert_unique(hint, ::boost::move(*pval));\
}\ }\
@@ -1052,9 +1052,9 @@ class flat_tree
iterator emplace_equal(BOOST_MOVE_UREF##N)\ iterator emplace_equal(BOOST_MOVE_UREF##N)\
{\ {\
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\ typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
value_type *pval = move_detail::force_ptr<value_type *>(v.data);\
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\ get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
stored_allocator_traits::construct(a, pval BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\ stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
value_type *pval = move_detail::force_ptr<value_type *>(&v);\
value_destructor<stored_allocator_type, value_type> d(a, *pval);\ value_destructor<stored_allocator_type, value_type> d(a, *pval);\
return this->insert_equal(::boost::move(*pval));\ return this->insert_equal(::boost::move(*pval));\
}\ }\
@@ -1063,9 +1063,9 @@ class flat_tree
iterator emplace_hint_equal(const_iterator hint BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ iterator emplace_hint_equal(const_iterator hint BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\ {\
typename dtl::aligned_storage <sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\ typename dtl::aligned_storage <sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
value_type *pval = move_detail::force_ptr<value_type *>(v.data);\
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\ get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
stored_allocator_traits::construct(a, pval BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\ stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
value_type *pval = move_detail::force_ptr<value_type *>(&v);\
value_destructor<stored_allocator_type, value_type> d(a, *pval);\ value_destructor<stored_allocator_type, value_type> d(a, *pval);\
return this->insert_equal(hint, ::boost::move(*pval));\ return this->insert_equal(hint, ::boost::move(*pval));\
}\ }\