Boost C++ Libraries: Ticket #4193: Multiple 'using' declarations in multi_index test https://svn.boost.org/trac10/ticket/4193 <p> The following simple patch removes some 'using std::swap' declarations in libs/multi_index/test/test_modifiers.cpp. Note that they are all in the same function under the same macro, and we do not remove the first one, so the code will function identically, but is now correct. </p> <p> Fixes problem in clang and comeau. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4193 Trac 1.4.3 Chris Jefferson Wed, 05 May 2010 15:29:45 GMT attachment set https://svn.boost.org/trac10/ticket/4193 https://svn.boost.org/trac10/ticket/4193 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_modifiers.patch</span> </li> </ul> <p> Simple patch to libs/multi_index/test/test_modifiers.cpp </p> Ticket Steven Watanabe Thu, 06 May 2010 02:40:28 GMT component changed; owner set https://svn.boost.org/trac10/ticket/4193#comment:1 https://svn.boost.org/trac10/ticket/4193#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Joaquín M López Muñoz</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">multi_index</span> </li> </ul> Ticket Joaquín M López Muñoz Thu, 06 May 2010 06:10:05 GMT <link>https://svn.boost.org/trac10/ticket/4193#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4193#comment:2</guid> <description> <p> Hi Chris, </p> <p> Can you please explain to me why having redundant using declarations is incorrect? I've just tested it in <a class="ext-link" href="http://www.comeaucomputing.com/tryitout/"><span class="icon">​</span>Comeau online</a> and found no problems. For your reference, the test snippet was: </p> <pre class="wiki">#include &lt;algorithm&gt; int main() { int x=0,y=0; using std::swap; swap(x,y); using std::swap; swap(x,y); } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 06 May 2010 07:29:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4193#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4193#comment:3</guid> <description> <p> Sorry, the reduced test I was using at comeau was not testing what I thought it was. </p> <p> It is still the case that this code does not compile in clang, because of the repeated std::swaps, but it may be a fault in clang, which could be fixed rather than introducing an #ifdef or patch. </p> <p> Will report back after further investigation </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 06 May 2010 14:23:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4193#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4193#comment:4</guid> <description> <p> From Doug Gregor, it appears that clang is right to reject the current code: </p> <p> Clang is correct; Comeau and g++ are wrong not to diagnose these errors. See C++ [namespace.udecl]p10: </p> <blockquote> <p> A using-declaration is a declaration and can therefore be used repeatedly </p> </blockquote> <p> where (and only where) multiple declarations are allowed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Thu, 06 May 2010 15:07:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4193#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4193#comment:5</guid> <description> <p> Huh? </p> <p> The standard reference seems to imply that </p> <pre class="wiki">#include &lt;algorithm&gt; int main() { using std::swap; using std::swap; } </pre><p> is legal iff </p> <pre class="wiki">int main() { void swap(int&amp;, int&amp;); void swap(int&amp;, int&amp;); } </pre><p> is legal. I would find it very weird if the latter is illegal. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Douglas Gregor</dc:creator> <pubDate>Thu, 06 May 2010 23:34:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4193#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4193#comment:6</guid> <description> <p> Oops, thanks Steven! I was convinced that the latter was ill-formed, but I've reviewed the standard again and you are correct. Clang now implements the right semantics, so we should close out this patch as being wrong. Sorry about that! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Douglas Gregor</dc:creator> <pubDate>Fri, 07 May 2010 19:56:41 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4193#comment:7 https://svn.boost.org/trac10/ticket/4193#comment:7 <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">invalid</span> </li> </ul> Ticket