It does the obvious thing of comparing all fields. This will be needed
for a clangd patch I have in the pipeline.
Details
Details
Diff Detail
Diff Detail
- Repository
- rC Clang
Event Timeline
Comment Actions
Any chance this can/should be unit tested? (also, in general (though might
not matter in this instance), symmetric operators like == should be
implemented as non-members (though they can still be friends and if they
are, can be defined inline in the class definition as a member could be),
so any implicit conversions apply equally to the LHS as the RHS of the
expression)
Comment Actions
- Add test
- Make operator== a function instead of method
- Add operator!= (so I can use EXPECT_NE in the test, and because it may be useful in general)
Comment Actions
In theory you'd need separate tests for op== and op!= returning false (currently all the tests would pass if both implementations returned true in all cases), but not the biggest deal.
Comment Actions
Add tests for both == and !=.
I need to rebuild ~800 files (because I pulled llvm/clang), so I did not
actually test it, but I'll do so before pushing tomorrow, of course.