Boost C++ Libraries: Ticket #7531: [container] shadowing warnings under gcc https://svn.boost.org/trac10/ticket/7531 <p> The following </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/container/vector.hpp&gt;</span><span class="cp"></span> <span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span><span class="o">*</span> <span class="n">argv</span><span class="p">[])</span> <span class="p">{</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><p> compiled with </p> <pre class="wiki">g++ -I/path/to/boost -Wshadow main.cpp </pre><p> yields </p> <pre class="wiki">/path/to/boost/boost/container/vector.hpp: In member function ‘void boost::container::vector&lt;T, A&gt;::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' </pre><p> 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 :( </p> <p> 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. </p> <p> Also, I don't think it matters, but this is on gcc 4.1.2. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7531 Trac 1.4.3 Ion Gaztañaga Thu, 18 Oct 2012 18:32:16 GMT <link>https://svn.boost.org/trac10/ticket/7531#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7531#comment:1</guid> <description> <p> Thanks for the report. Please go ahead with changes if you can get permission from the release managers. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>jeffrey.hellrung</dc:creator> <pubDate>Tue, 23 Oct 2012 12:56:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7531#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7531#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81050" title="refs #7531 (variable shadowing in container and intrusive)">[81050]</a>) refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7531" title="#7531: Bugs: [container] shadowing warnings under gcc (closed: fixed)">#7531</a> (variable shadowing in container and intrusive) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>jeffrey.hellrung</dc:creator> <pubDate>Fri, 26 Oct 2012 02:56:01 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7531#comment:3 https://svn.boost.org/trac10/ticket/7531#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81066" title="merge trunk to release; fixes #7531 variable shadowing warning in ...">[81066]</a>) merge trunk to release; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7531" title="#7531: Bugs: [container] shadowing warnings under gcc (closed: fixed)">#7531</a> variable shadowing warning in container and intrusive </p> Ticket