[patch] Use a more idiomatic bool operator in ErrorOr

Aaron Ballman aaron at aaronballman.com
Thu Jan 16 10:20:49 PST 2014


On Thu, Jan 16, 2014 at 1:13 PM, Alp Toker <alp at nuanti.com> wrote:
>
> On 16/01/2014 18:05, Reid Kleckner wrote:
>>
>> With the impending switch to C++11, feel free to cleanup instances of this
>> safe bool idiom.
>
>
> Very unfortunate news on that front: explicit operators aren't support until
> MSVC 2013.
>
>   http://msdn.microsoft.com/en-us/library/hh567368.aspx
>
> That means LLVM_EXPLICIT will still be defined to nothing on MSVC 2012,
> resulting in inappropriate conversions taking precedence over the bool
> operator.

At least the 2013 build bot will still catch problems if it's misused,
but good point about using the compatibility macro.

~Aaron



More information about the llvm-commits mailing list