Boost C++ Libraries: Ticket #3645: iterator_facade does not work in presence of ::implicit_cast https://svn.boost.org/trac10/ticket/3645 <p> iterator_facade does not compile if there is a function template named implicit_cast in global namespace and Value template argument of iterator_facade is a type from global namespace. </p> <p> Minimal test case is attached (minimal_boost.cc). I also reduced it to something that does not use boost (minimal_no_boost.cc). </p> <p> Reproducible with Comeau 4.3.0.1, gcc 4.4.0 and Clang, but *not* with gcc 4.3.1. </p> <p> I'm also attaching a patch (one line -- qualify call to implicit_cast in iterator_facade.hpp). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3645 Trac 1.4.3 romanp@… Thu, 19 Nov 2009 17:21:35 GMT attachment set https://svn.boost.org/trac10/ticket/3645 https://svn.boost.org/trac10/ticket/3645 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">minimal_boost.cc</span> </li> </ul> <p> Minimal test case demonstrating compilation errors </p> Ticket romanp@… Thu, 19 Nov 2009 17:22:11 GMT attachment set https://svn.boost.org/trac10/ticket/3645 https://svn.boost.org/trac10/ticket/3645 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">minimal_no_boost.cc</span> </li> </ul> <p> Minimal test case without boost demonstrating compilation errors </p> Ticket romanp@… Thu, 19 Nov 2009 17:22:46 GMT attachment set https://svn.boost.org/trac10/ticket/3645 https://svn.boost.org/trac10/ticket/3645 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">iterator_facade.patch</span> </li> </ul> <p> Patch (qualify call to implicit_cast in iterator_facade.hpp) </p> Ticket roman.perepelitsa@… Thu, 19 Nov 2009 17:32:12 GMT cc changed https://svn.boost.org/trac10/ticket/3645#comment:1 https://svn.boost.org/trac10/ticket/3645#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">roman.perepelitsa@…</span> added </li> </ul> Ticket romanp@… Thu, 19 Nov 2009 18:04:41 GMT <link>https://svn.boost.org/trac10/ticket/3645#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3645#comment:2</guid> <description> <p> The compiler is right to complain about ambiguity. </p> <p> 14.8.1 - Explicit template argument specification [temp.arg.explicit] </p> <p> -6- [Note: For simple function names, argument dependent lookup (basic.lookup.koenig) applies even when the function name is not visible within the scope of the call. This is because the call still has the syntactic form of a function call (basic.lookup.unqual). But when a function template with explicit template arguments is used, the call does not have the correct syntactic form unless there is a function template with that name visible at the point of the call. If no such name is visible, the call is not syntactically well-formed and argument-dependent lookup does not apply. If some such name is visible, argument dependent lookup applies and additional function templates may be found in other namespaces. [Example: </p> <p> namespace A { </p> <blockquote> <p> struct B { }; template&lt;int X&gt; void f(B); </p> </blockquote> <p> } namespace C { </p> <blockquote> <p> template&lt;class T&gt; void f(T t); </p> </blockquote> <p> } void g(A::B b) { </p> <blockquote> <p> f&lt;3&gt;(b); <em> ill-formed: not a function call A::f&lt;3&gt;(b); </em> well-formed C::f&lt;3&gt;(b); <em> ill-formed; argument dependent lookup </em></p> <blockquote> <p> <em> only applies to unqualified names </em></p> </blockquote> <p> using C::f; f&lt;3&gt;(b); <em> well-formed because C::f is visible; then </em></p> <blockquote> <p> <em> A::f is found by argument dependent lookup </em></p> </blockquote> </blockquote> <p> } </p> <p> --- end example] --- end note] </p> <p> Which means that iterator_facade has unintended point of extension (ADL enabled call). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Fri, 20 Nov 2009 03:20:24 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/3645#comment:3 https://svn.boost.org/trac10/ticket/3645#comment:3 <ul> <li><strong>owner</strong> set to <span class="trac-author">Dave Abrahams</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">iterator</span> </li> </ul> Ticket romanp@… Fri, 27 Nov 2009 09:31:52 GMT <link>https://svn.boost.org/trac10/ticket/3645#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3645#comment:4</guid> <description> <p> David, could you take a look? </p> <p> In Google, we had to patch boost locally. It would be great to push the fix upstream. </p> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Yasskin <jyasskin@…></author> <pubDate>Wed, 02 Dec 2009 04:33:49 GMT</pubDate> <title>cc changed https://svn.boost.org/trac10/ticket/3645#comment:5 https://svn.boost.org/trac10/ticket/3645#comment:5 <ul> <li><strong>cc</strong> <span class="trac-author">jyasskin@…</span> added </li> </ul> Ticket Marshall Clow Thu, 06 Jan 2011 23:44:24 GMT owner changed https://svn.boost.org/trac10/ticket/3645#comment:6 https://svn.boost.org/trac10/ticket/3645#comment:6 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Dave Abrahams</span> to <span class="trac-author">Marshall Clow</span> </li> </ul> Ticket Marshall Clow Thu, 06 Jan 2011 23:45:12 GMT <link>https://svn.boost.org/trac10/ticket/3645#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3645#comment:7</guid> <description> <p> Patch applied in revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/67738" title="Apply patch for #3645; will merge to release after tests cycle">[67738]</a>; will wait for tests to cycle before merging to release branch. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Sat, 08 Jan 2011 18:46:41 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3645#comment:8 https://svn.boost.org/trac10/ticket/3645#comment:8 <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> Fix merged to release branch in <a class="changeset" href="https://svn.boost.org/trac10/changeset/67792" title="Merging fixes to release; fixes #2294 fixes #4918 fixes #3645 refs ...">[67792]</a> </p> Ticket