Boost C++ Libraries: Ticket #7850: polymorphic_iarchive_route.hpp: declaration of 'is' shadows a member of 'this' https://svn.boost.org/trac10/ticket/7850 <p> When compiling the demo application: ./libs/serialization/example/demo_polymorphic.cpp </p> <p> using gcc (in our case 3.4.3) with –Wall –Werror, this fails due to: </p> <p> . /boost/archive/polymorphic_text_iarchive.hpp:37: instantiated from here ./boost/archive/detail/polymorphic_iarchive_route.hpp:199: warning: declaration of 'is' shadows a member of 'this' </p> <p> I checked this in the latest release (aka 1.52) and error is still in: </p> <p> It is caused by the definition in: </p> <p> <a href="http://www.boost.org/doc/libs/1_52_0/boost/archive/basic_text_iprimitive.hpp">http://www.boost.org/doc/libs/1_52_0/boost/archive/basic_text_iprimitive.hpp</a> : </p> <pre class="wiki">template&lt;class IStream&gt; class basic_text_iprimitive { #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS protected: #else public: #endif IStream &amp;is; io::ios_flags_saver flags_saver; </pre><p> combined with the implementation in: <a href="http://www.boost.org/doc/libs/1_52_0/boost/archive/detail/polymorphic_iarchive_route.hpp">http://www.boost.org/doc/libs/1_52_0/boost/archive/detail/polymorphic_iarchive_route.hpp</a> : </p> <pre class="wiki"> // all current archives take a stream as constructor argument template &lt;class _Elem, class _Tr&gt; polymorphic_iarchive_route( std::basic_istream&lt;_Elem, _Tr&gt; &amp; is, unsigned int flags = 0 ) : ArchiveImplementation(is, flags) {} virtual ~polymorphic_iarchive_route(){}; </pre><p> As you can see: in the basic_test_iprimitive, “is” is a member (aka IStream) while in polymorphic_iarchive_route.hpp it is an argument in <a class="missing wiki">ArchiveImplementation</a> </p> <p> I fixed it in our case by replacing the “is” in the argument case with “is_arg”: </p> <pre class="wiki"> // all current archives take a stream as constructor argument template &lt;class _Elem, class _Tr&gt; polymorphic_iarchive_route( std::basic_istream&lt;_Elem, _Tr&gt; &amp; is_arg, unsigned int flags = 0 ) : ArchiveImplementation(is_arg, flags) {} virtual ~polymorphic_iarchive_route(){}; </pre><p> Best Regards, Luc </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7850 Trac 1.4.3 Robert Ramey Wed, 06 Feb 2013 19:31:16 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7850#comment:1 https://svn.boost.org/trac10/ticket/7850#comment:1 <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> Ticket