Boost logo

Boost Users :

Subject: [Boost-users] [ptr_container] Regression: ptr_multimap breaks Wextra build in version 1.49.0
From: Philipp Münzel (mailing-lists_at_[hidden])
Date: 2012-06-27 03:54:51


Hi fellows,

I'm using gcc 4.2.1 on OSX 10.7.4 and I've recently updated from boost 1.47 to 1.49.0.
My project uses ptr_multimaps. My project is configured to use the gcc flags -Werror -Wall -Wextra because I like to be alerted early if something can go wrong. Using -Werror is kind of a self-imposed restriction to keep my code clean of dirty hacks. I've been used to compile my code this way since about boost 1.44.

With the update to 1.49 however, building with -Werror -Wextra is no longer possible, because I'm getting the following warning:

/usr/local/boost/include/boost/ptr_container/ptr_map_adapter.hpp: In copy constructor 'boost::ptr_multimap_adapter<T, VoidPtrMultiMap, CloneAllocator, Ordered>::ptr_multimap_adapter(const boost::ptr_multimap_adapter<T, VoidPtrMultiMap, CloneAllocator, Ordered>&) [with T = Foo, VoidPtrMultiMap = std::multimap<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*> > >, CloneAllocator = boost::heap_clone_allocator, bool Ordered = true]':
/usr/local/boost/include/boost/ptr_container/ptr_map.hpp:89: instantiated from here
/usr/local/boost/include/boost/ptr_container/ptr_map_adapter.hpp:727: warning: base class 'class boost::ptr_container_detail::ptr_map_adapter_base<Foo, std::multimap<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*> > >, boost::heap_clone_allocator, true>' should be explicitly initialized in the copy constructor

The only possibility to compile this is to remove -Wextra, because gcc has no separate warning option to turn off the copy constructor check (see [1]), so I lose not only this check, but also everything else enabled by -Wextra, which I'd be very unhappy with.
For the time being, I just removed -Werror, but this totally clutters up my build output now, which usually allows me to spot every problem really quick, because it is so brief.

Since this is a regression (it worked until the 1.49.0 update), I'd be happy if someone can check how this was introduced in 1.49.0 and open a ticket for the incriminating change.

Regards,
Philipp

[1] http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net