Romain Geissler
d10c901381
Fix couple of -Wdeprecated-copy when using clang with std=gnu++20 or gnu++2b.
...
======= ERROR 1 ========
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/accumulators/accumulators.hpp:12:
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/accumulators/framework/accumulator_set.hpp:64:53: error: definition of implicit copy constructor for 'accumulator_visitor<boost::par
ameter::aux::flat_like_arg_list<boost::parameter::aux::flat_like_arg_tuple<boost::accumulators::tag::accumulator, boost::parameter::aux::tagged_argument<boost::accumulators::tag::ac
cumulator, boost::accumulators::accumulator_set<double, boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max,
boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>>>, boost::parameter::aux::flat_like_arg_tuple<boost::accumulators::tag::sample, boost::parameter::aux::tagged_a
rgument<boost::accumulators::tag::sample, const double>>>>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
BOOST_DELETED_FUNCTION(accumulator_visitor &operator =(accumulator_visitor const &))
^
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/accumulators/framework/accumulator_set.hpp:303:46: note: in implicit copy constructor for 'boost::accumulators::detail::accumulator_
visitor<boost::parameter::aux::flat_like_arg_list<boost::parameter::aux::flat_like_arg_tuple<boost::accumulators::tag::accumulator, boost::parameter::aux::tagged_argument<boost::acc
umulators::tag::accumulator, boost::accumulators::accumulator_set<double, boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumu
lators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>>>, boost::parameter::aux::flat_like_arg_tuple<boost::accumulators::tag::sample, boost::parame
ter::aux::tagged_argument<boost::accumulators::tag::sample, const double>>>>' first required here
fusion::for_each(this->accumulators, func);
^
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/accumulators/framework/accumulator_set.hpp:380:9: note: in instantiation of function template specialization 'boost::accumulators::a
ccumulator_set<double, boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>::visit<boost::accumulators::detail::accumulator_visitor<boost::parameter::aux::flat_like_arg_list<boost::parameter::aux::flat_like_arg_tuple<boost::accumulators::tag::accumulator, boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<double, boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>>>, boost::parameter::aux::flat_like_arg_tuple<boost::accumulators::tag::sample, boost::parameter::aux::tagged_argument<boost::accumulators::tag::sample, const double>>>>>' requested here
, BOOST_ACCUMULATORS_ACCUMULATOR_SET_FUN_OP
^
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/preprocessor/repetition/repeat_from_to.hpp:35:34: note: expanded from macro 'BOOST_PP_REPEAT_FROM_TO'
^
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/preprocessor/cat.hpp:22:32: note: expanded from macro 'BOOST_PP_CAT'
^
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/preprocessor/cat.hpp:29:34: note: expanded from macro 'BOOST_PP_CAT_I'
^
<scratch space>:122:1: note: expanded from here
BOOST_PP_REPEAT_FROM_TO_1
^
src/Tests.cpp:349:38: note: in instantiation of function template specialization 'boost::accumulators::accumulator_set<double, boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>::operator()<double>' requested here
_deviationAccumulator(aDeviation);
^
======= ERROR 2 ========
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/accumulators/accumulators.hpp:12:
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/accumulators/framework/accumulator_set.hpp:35:
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/accumulators/framework/accumulators/droppable_accumulator.hpp:52:53: error: definition of implicit copy constructor for 'add_ref_visitor<boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<double, boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>>>>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
BOOST_DELETED_FUNCTION(add_ref_visitor &operator =(add_ref_visitor const &))
^
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/accumulators/framework/accumulator_set.hpp:314:41: note: in implicit copy constructor for 'boost::accumulators::detail::add_ref_visitor<boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<double, boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>>>>' first required here
fusion::for_each(filtered_accs, func);
^
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/accumulators/framework/accumulator_set.hpp:175:24: note: in instantiation of function template specialization 'boost::accumulators::accumulator_set<double, boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>::visit_if<boost::accumulators::detail::contains_feature_of_<boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>, boost::accumulators::detail::add_ref_visitor<boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<double, boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>>>>>' requested here
this->template visit_if<detail::contains_feature_of_<Features> >(
^
src/Tests.cpp:363:26: note: in instantiation of member function 'boost::accumulators::accumulator_set<double, boost::accumulators::features<boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::moment<2>>>::accumulator_set' requested here
DeviationAccumulator aDeviationAccumulator;
^
2023-08-24 19:51:19 +00:00
Kefu Chai
ecdc3d41be
always initialize member variable
...
in this change, impl::extended_p_square_quantile_impl::probability is
zero-initialized to silence -Wuninitialized warning from GCC-13.
despite that this variable is always initialized in
impl::extended_p_square_quantile_impl::result(), it is still referenced
by, for instance the copy constructor, which could be called before
`result()` gets called. and GCC-13 rightly warn us like:
In copy constructor ‘constexpr boost::accumulators::impl::extended_p_square_quantile_impl<double, boost::accumulators::unweighted, boost::accumulators::quadratic>::extended_p_square_quantile_impl(const boost::accumulators::impl::extended_p_square_quantile_impl<double, boost::accumulators::unweighted, boost::accumulators::quadratic>&)’,
inlined from ‘boost::accumulators::detail::accumulator_wrapper<Accumulator, Feature>::accumulator_wrapper(const boost::accumulators::detail::accumulator_wrapper<Accumulator, Feature>&) [with Accumulator = boost::accumulators::impl::extended_p_square_quantile_impl<double, boost::accumulators::unweighted, boost::accumulators::quadratic>; Feature = boost::accumulators::tag::extended_p_square_quantile_quadratic]’ at /usr/include/boost/accumulators/framework/depends_on.hpp:320:69,
inlined from ‘constexpr boost::fusion::cons<Car, Cdr>::cons(typename boost::fusion::detail::call_param<Car>::type, typename boost::fusion::detail::call_param<Cdr>::type) [with Car = boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::extended_p_square_quantile_impl<double, boost::accumulators::unweighted, boost::accumulators::quadratic>, boost::accumulators::tag::extended_p_square_quantile_quadratic>; Cdr = boost::fusion::cons<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::sum_impl<double, boost::accumulators::tag::sample>, boost::accumulators::tag::sum>, boost::fusion::cons<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::mean_impl<double, boost::accumulators::tag::sum>, boost::accumulators::tag::mean>, boost::fusion::cons<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::max_impl<double>, boost::accumulators::tag::max>, boost::fusion::nil_> > >]’ at /usr/include/boost/fusion/container/list/cons.hpp:66:15,
inlined from ‘static boost::accumulators::detail::build_acc_list<First, Last, false>::type boost::accumulators::detail::build_acc_list<First, Last, false>::call(const Args&, const First&, const Last&) [with Args = boost::parameter::aux::flat_like_arg_list<boost::parameter::aux::flat_like_arg_tuple<boost::accumulators::tag::accumulator, boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<double, boost::accumulators::stats<boost::accumulators::tag::extended_p_square_quantile(boost::accumulators::quadratic), boost::accumulators::tag::mean, boost::accumulators::tag::max, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, void> >, std::integral_constant<bool, true> >, boost::parameter::aux::flat_like_arg_tuple<boost::accumulators::tag::extended_p_square_probabilities_<0>, boost::parameter::aux::tagged_argument<boost::accumulators::tag::extended_p_square_probabilities_<0>, std::array<double, 4> >, std::integral_constant<bool, true> > >; First = boost::fusion::mpl_iterator<boost::mpl::v_iter<boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::max_impl<double>, boost::accumulators::tag::max>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::mean_impl<double, boost::accumulators::tag::sum>, boost::accumulators::tag::mean>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::sum_impl<double, boost::accumulators::tag::sample>, boost::accumulators::tag::sum>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::extended_p_square_quantile_impl<double, boost::accumulators::unweighted, boost::accumulators::quadratic>, boost::accumulators::tag::extended_p_square_quantile_quadratic>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::extended_p_square_impl<double>, boost::accumulators::tag::extended_p_square>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::count_impl, boost::accumulators::tag::count>, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0>, 0>, 0>, 2> >; Last = boost::fusion::mpl_iterator<boost::mpl::v_iter<boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::max_impl<double>, boost::accumulators::tag::max>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::mean_impl<double, boost::accumulators::tag::sum>, boost::accumulators::tag::mean>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::sum_impl<double, boost::accumulators::tag::sample>, boost::accumulators::tag::sum>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::extended_p_square_quantile_impl<double, boost::accumulators::unweighted, boost::accumulators::quadratic>, boost::accumulators::tag::extended_p_square_quantile_quadratic>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::extended_p_square_impl<double>, boost::accumulators::tag::extended_p_square>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::count_impl, boost::accumulators::tag::count>, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0>, 0>, 0>, 6> >]’ at /usr/include/boost/accumulators/framework/depends_on.hpp:252:86,
inlined from ‘static boost::accumulators::detail::build_acc_list<First, Last, false>::type boost::accumulators::detail::build_acc_list<First, Last, false>::call(const Args&, const First&, const Last&) [with Args = boost::parameter::aux::flat_like_arg_list<boost::parameter::aux::flat_like_arg_tuple<boost::accumulators::tag::accumulator, boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<double, boost::accumulators::stats<boost::accumulators::tag::extended_p_square_quantile(boost::accumulators::quadratic), boost::accumulators::tag::mean, boost::accumulators::tag::max, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, void> >, std::integral_constant<bool, true> >, boost::parameter::aux::flat_like_arg_tuple<boost::accumulators::tag::extended_p_square_probabilities_<0>, boost::parameter::aux::tagged_argument<boost::accumulators::tag::extended_p_square_probabilities_<0>, std::array<double, 4> >, std::integral_constant<bool, true> > >; First = boost::fusion::mpl_iterator<boost::mpl::v_iter<boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::max_impl<double>, boost::accumulators::tag::max>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::mean_impl<double, boost::accumulators::tag::sum>, boost::accumulators::tag::mean>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::sum_impl<double, boost::accumulators::tag::sample>, boost::accumulators::tag::sum>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::extended_p_square_quantile_impl<double, boost::accumulators::unweighted, boost::accumulators::quadratic>, boost::accumulators::tag::extended_p_square_quantile_quadratic>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::extended_p_square_impl<double>, boost::accumulators::tag::extended_p_square>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::count_impl, boost::accumulators::tag::count>, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0>, 0>, 0>, 1> >; Last = boost::fusion::mpl_iterator<boost::mpl::v_iter<boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::max_impl<double>, boost::accumulators::tag::max>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::mean_impl<double, boost::accumulators::tag::sum>, boost::accumulators::tag::mean>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::sum_impl<double, boost::accumulators::tag::sample>, boost::accumulators::tag::sum>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::extended_p_square_quantile_impl<double, boost::accumulators::unweighted, boost::accumulators::quadratic>, boost::accumulators::tag::extended_p_square_quantile_quadratic>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::extended_p_square_impl<double>, boost::accumulators::tag::extended_p_square>, boost::mpl::v_item<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::count_impl, boost::accumulators::tag::count>, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0>, 0>, 0>, 6> >]’ at /usr/include/boost/accumulators/framework/depends_on.hpp:252:86:
/usr/include/boost/accumulators/statistics/extended_p_square_quantile.hpp:57:12: error: ‘<unnamed>.boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::extended_p_square_quantile_impl<double, boost::accumulators::unweighted, boost::accumulators::quadratic>, boost::accumulators::tag::extended_p_square_quantile_quadratic>::<unnamed>.boost::accumulators::impl::extended_p_square_quantile_impl<double, boost::accumulators::unweighted, boost::accumulators::quadratic>::probability’ is used uninitialized [-Werror=uninitialized]
57 | struct extended_p_square_quantile_impl
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Kefu Chai <tchaikov@gmail.com >
2023-04-27 13:16:53 +08:00