<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 16, 2014 at 10:38 AM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On 16/01/2014 18:20, Aaron Ballman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, Jan 16, 2014 at 1:13 PM, Alp Toker <<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 16/01/2014 18:05, Reid Kleckner wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
With the impending switch to C++11, feel free to cleanup instances of this<br>
safe bool idiom.<br>
</blockquote>
<br>
Very unfortunate news on that front: explicit operators aren't support until<br>
MSVC 2013.<br>
<br>
   <a href="http://msdn.microsoft.com/en-us/library/hh567368.aspx" target="_blank">http://msdn.microsoft.com/en-<u></u>us/library/hh567368.aspx</a><br>
<br>
That means LLVM_EXPLICIT will still be defined to nothing on MSVC 2012,<br>
resulting in inappropriate conversions taking precedence over the bool<br>
operator.<br>
</blockquote>
At least the 2013 build bot will still catch problems if it's misused,<br>
but good point about using the compatibility macro.<br>
</blockquote>
<br></div>
Yes, I switched it on for MSVC 2013 back in r198142, along with updates to the other macros.<br>
<br>
That said, the current setup is a little dangerous and the only fully safe use I can see of the macro is for the benefit of sub-projects that have already pushed ahead and dropped MSVC 2012.<br>
<br>
In common use when the macro is turned off it's entirely possible an int conversion will silently be chosen leading to runtime brokenness :-/<br></blockquote><div><br></div><div>Do we have types with any such dangerous duplicate conversions? I'd say that's likely bad design even in a world with explicit bool conversion & I'd treat those as code/design bugs and on that basis I'd still prefer to nuke safe bools and use LLVM_EXPLICIT entirely.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Perhaps we should document this. Thoughts?<span class="HOEnZb"><font color="#888888"><br>
<br>
Alp.</font></span><div class="im HOEnZb"><br>
<br>
<br>
-- <br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br>
<br></div><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>