Boost C++ Libraries: Ticket #8651: Uneeded usage of namespace causes problems for the compiler https://svn.boost.org/trac10/ticket/8651 <p> using debian sid Package: libboost1.53-dev Source: boost1.53 Version: 1.53.0-5 </p> <p> The gcc compiler crashes using some options when compiling (dump translation unit) </p> <p> Here is a small change to work around the crash : </p> <p> namespace boost { </p> <blockquote> <p> namespace detail { namespace variant { </p> </blockquote> <dl class="wiki"><dt>struct variant_hasher: public <em>boost</em></dt><dd> static_visitor&lt;std::size_t&gt; { template &lt;class T&gt; std::size_t operator()(T const&amp; val) const { <em>using namespace boost; hash&lt;T&gt; hasher; return hasher(val); } }; }} </dd></dl> <p> } </em></p> <p> It is the uneeded namespace usage that causes the problem. </p> <p> see the gcc Bug 57524 - internal compiler error on dump translation unit </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8651 Trac 1.4.3 James Michael DuPont <jamesmikedupont@…> Wed, 05 Jun 2013 11:01:32 GMT <link>https://svn.boost.org/trac10/ticket/8651#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8651#comment:1</guid> <description> <p> Formatted code </p> <pre class="wiki">namespace boost { namespace detail { namespace variant { struct variant_hasher: public //boost:: static_visitor&lt;std::size_t&gt; { template &lt;class T&gt; std::size_t operator()(T const&amp; val) const { //using namespace boost; hash&lt;T&gt; hasher; return hasher(val); } }; }} } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Thu, 06 Jun 2013 14:57:39 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/8651#comment:2 https://svn.boost.org/trac10/ticket/8651#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">antoshkka@…</span> added </li> </ul> <p> Can this error be reproduced with the following code (<code>hash&lt;T&gt;</code> is fully qualified): </p> <pre class="wiki">namespace boost { namespace detail { namespace variant { struct variant_hasher: public boost::static_visitor&lt;std::size_t&gt; { template &lt;class T&gt; std::size_t operator()(T const&amp; val) const { boost::hash&lt;T&gt; hasher; return hasher(val); } }; }} } </pre><p> If error is not reproduced, I'll commit fix to 1.54.0 </p> Ticket James Michael DuPont <jamesmikedupont@…> Thu, 06 Jun 2013 23:51:56 GMT <link>https://svn.boost.org/trac10/ticket/8651#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8651#comment:3</guid> <description> <p> That fixes the crash, thanks! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Sat, 08 Jun 2013 07:32:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8651#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8651#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/84683" title="Workaround for GCC bug (refs #8651)">[84683]</a>) Workaround for GCC bug (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8651" title="#8651: Bugs: Uneeded usage of namespace causes problems for the compiler (closed: fixed)">#8651</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Wed, 12 Jun 2013 08:08:59 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8651#comment:5 https://svn.boost.org/trac10/ticket/8651#comment:5 <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/84747" title="Merge from trunk GCC workaround (fixes #8651)">[84747]</a>) Merge from trunk GCC workaround (fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8651" title="#8651: Bugs: Uneeded usage of namespace causes problems for the compiler (closed: fixed)">#8651</a>) </p> Ticket