[llvm] r188582 - allow != to compare PointerUnion, we already support ==.

David Blaikie dblaikie at gmail.com
Wed Aug 21 14:34:27 PDT 2013


On Fri, Aug 16, 2013 at 3:32 PM, Chris Lattner <clattner at apple.com> wrote:
>
> On Aug 16, 2013, at 3:16 PM, Chandler Carruth <chandlerc at google.com> wrote:
>
>
> On Fri, Aug 16, 2013 at 3:09 PM, Chris Lattner <sabre at nondot.org> wrote:
>>
>> Author: lattner
>> Date: Fri Aug 16 17:09:02 2013
>> New Revision: 188582
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=188582&view=rev
>> Log:
>> allow != to compare PointerUnion, we already support ==.
>
>
> Unit test? ;]
>
>
> *bows head in shame*

Some basic test cases added in r188933.

(I was a little surprised that PointerUnion doesn't have a "null"
state, but that's fair - it does mean the default constructed
PointerUnion is actually the null value of the first type parameter
(eg: PointerUnion<int*, float*>().is<int*>() returns true))

I'm curious though - why did you make these comparison operators
static? We don't usually do that for function templates, do we?



More information about the llvm-commits mailing list