[Boost-bugs] [Boost C++ Libraries] #3285: Boost::Circular_Buffer: Copy Constructor Elicits a Warning from GCC 4.0.1 about Parent Constructor

Subject: [Boost-bugs] [Boost C++ Libraries] #3285: Boost::Circular_Buffer: Copy Constructor Elicits a Warning from GCC 4.0.1 about Parent Constructor
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-07-23 16:44:10


#3285: Boost::Circular_Buffer: Copy Constructor Elicits a Warning from GCC 4.0.1
about Parent Constructor
--------------------------------------+-------------------------------------
 Reporter: gerickson@… | Owner: jano_gaspar
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: circular_buffer
  Version: Boost 1.39.0 | Severity: Problem
 Keywords: |
--------------------------------------+-------------------------------------
 When compiling code that uses, either directly or indirectly,
 boost::circular_buffer (e.g. accumulators and statistics) with a copious
 level of warnings enabled and warnings treated as errors enabled, the
 following is generated for boost::circular_buffer:

                 /Developer/usr/bin/gcc-4.0 -x c++ -arch i386 -fmessage-
 length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -W -Wall
 -Wcast-align -Wextra -Wformat-security -Wpointer-arith -Wwrite-strings
 -Werror -Wreturn-type -Wformat -Wunused-function -Wunused-label -Wunused-
 parameter -Wunused-variable -Wunused-value -Wshadow -Wsign-compare
 -DDEBUG=1 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mfix-and-continue
 -fvisibility-inlines-hidden -mmacosx-version-min=10.4 -gdwarf-2
 -F${BuildRoot}/Debug -I${BuildRoot}/Debug/include
 -I${BuildRoot}/Debug/boost/include -c test.cpp -o test.o
         cc1plus: warnings being treated as errors
         ${BuildRoot}/Debug/boost/include/boost/circular_buffer/base.hpp:
 In copy constructor ‘boost::circular_buffer<T,
 Alloc>::circular_buffer(const boost::circular_buffer<T, Alloc>&) [with T =
 float, Alloc = std::allocator<float>]’:
 ${BuildRoot}/Debug/boost/include/boost/accumulators/statistics/rolling_window.hpp:39:
 instantiated from
 â€˜boost::accumulators::detail::accumulator_wrapper<Accumulator,
 Feature>::accumulator_wrapper(const
 boost::accumulators::detail::accumulator_wrapper<Accumulator, Feature>&)
 [with Accumulator =
 boost::accumulators::impl::rolling_window_plus1_impl<float>, Feature =
 boost::accumulators::tag::rolling_window_plus1]’
 ${BuildRoot}/Debug/boost/include/boost/fusion/container/list/cons.hpp:85:
 instantiated from ‘boost::fusion::cons<Car, Cdr>::cons(const
 boost::fusion::cons<Car, Cdr>&) [with Car =
 boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::rolling_window_plus1_impl<float>,
 boost::accumulators::tag::rolling_window_plus1>, Cdr =
 boost::fusion::cons<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::rolling_sum_impl<float>,
 boost::accumulators::tag::rolling_sum>,
 boost::fusion::cons<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::rolling_count_impl<float>,
 boost::accumulators::tag::rolling_count>,
 boost::fusion::cons<boost::accumulators::detail::accumulator_wrapper<boost::accumulators::impl::rolling_mean_impl<float>,
 boost::accumulators::tag::rolling_mean>, boost::fusion::nil> > >]’
 ${BuildRoot}/Debug/boost/include/boost/accumulators/framework/accumulator_set.hpp:163:
 instantiated from ‘boost::accumulators::accumulator_set<Sample, Features,
 Weight>::accumulator_set(const A1&) [with A1 =
 boost::parameter::aux::tagged_argument<boost::accumulators::tag::rolling_window_size_<0>,
 size_t>, Sample = float, Features =
 boost::accumulators::stats<boost::accumulators::tag::rolling_mean,
 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, mpl_::na, mpl_::na>, Weight = void]’
         test.cpp:160: instantiated from here
 '''${BuildRoot}/Debug/boost/include/boost/circular_buffer/base.hpp:1069:
 warning: base class ‘class boost::cb_details::debug_iterator_registry’
 should be explicitly initialized in the copy constructor'''

 The fix for this, as suggested by the compiler, is to explicitly invoke
 the parent constructor in the copy constructor when debugging is enabled
 (see attached patch).

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3285>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC