Opened 10 years ago

Closed 10 years ago

#7531 closed Bugs (fixed)

[container] shadowing warnings under gcc

Reported by: jeffrey.hellrung Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: container
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc:

Description

The following

#include <boost/container/vector.hpp>

int main(int argc, char* argv[]) { return 0; }

compiled with

g++ -I/path/to/boost -Wshadow main.cpp

yields

/path/to/boost/boost/container/vector.hpp: In member function ‘void boost::container::vector<T, A>::priv_assign_aux(FwdIt, FwdIt, std::forward_iterator_tag)’:
/path/to/boost/boost/container/vector.hpp:2066: warning: declaration of ‘end’ shadows a member of 'this'

Similar warnings appear when including flat_set and flat_map (and not sure, perhaps other containers as well). Seems most if not all such warnings are easily avoided by using a different name for the relevant local variables. This one of the warnings turned on by one of the software groups at Sandia, where warnings are treated as errors, hence this precludes the use of Boost.Container within this software. Which is very sad for me :(

If you want, Ion, I can make the necessary changes in trunk tonight (U.S. time) and soon after merge to release in time to get this into 1.52.0.

Also, I don't think it matters, but this is on gcc 4.1.2.

Change History (3)

comment:1 by Ion Gaztañaga, 10 years ago

Thanks for the report. Please go ahead with changes if you can get permission from the release managers.

comment:2 by jeffrey.hellrung, 10 years ago

(In [81050]) refs #7531 (variable shadowing in container and intrusive)

comment:3 by jeffrey.hellrung, 10 years ago

Resolution: fixed
Status: newclosed

(In [81066]) merge trunk to release; fixes #7531 variable shadowing warning in container and intrusive

Note: See TracTickets for help on using tickets.