<meta charset="utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Hi,<div><br></div><div>cat > <a href="http://out.mm" target="_blank" style="color: rgb(66, 99, 171); ">out.mm</a> << EOF</div>
<div><div>class A {</div><div> public:</div><div> void operator<<(bool n);</div><div> void operator<<(const void* p);</div><div>};</div><div><br></div><div>int f() {</div><div> id b;</div><div> A a;</div>
<div> a << b;</div><div>}</div></div><div>EOF</div><div><br></div><div>g++ -c <a href="http://out.mm" target="_blank" style="color: rgb(66, 99, 171); ">out.mm</a> #works</div><div>clang++ -c <a href="http://out.mm" target="_blank" style="color: rgb(66, 99, 171); ">out.mm</a></div>
<div><div>test.mm:13:5: error: use of overloaded operator '<<' is ambiguous</div><div> a << b;</div><div> ~ ^ ~</div><div>test.mm:6:9: note: candidate function</div><div> void operator<<(bool n);</div>
<div> ^</div><div>test.mm:7:9: note: candidate function</div><div> void operator<<(const void* p);</div><div> ^</div><div>1 error generated.</div></div><div><br></div><div>Is this intentional? Should I file a bug?</div>
<div><br>Thanks,</div><div>Nico</div></span>