<div dir="ltr">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)</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 12, 2018 at 1:48 PM Simon Marchi via Phabricator via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">simark created this revision.<br>
Herald added subscribers: cfe-commits, ioeric, ilya-biryukov.<br>
<br>
It does the obvious thing of comparing all fields. This will be needed<br>
for a clangd patch I have in the pipeline.<br>
<br>
<br>
Repository:<br>
rC Clang<br>
<br>
<a href="https://reviews.llvm.org/D49265" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49265</a><br>
<br>
Files:<br>
include/clang/Tooling/CompilationDatabase.h<br>
<br>
<br>
Index: include/clang/Tooling/CompilationDatabase.h<br>
===================================================================<br>
--- include/clang/Tooling/CompilationDatabase.h<br>
+++ include/clang/Tooling/CompilationDatabase.h<br>
@@ -59,6 +59,11 @@<br>
<br>
/// The output file associated with the command.<br>
std::string Output;<br>
+<br>
+ bool operator==(const CompileCommand &RHS) const {<br>
+ return Directory == RHS.Directory && Filename == RHS.Filename &&<br>
+ CommandLine == RHS.CommandLine && Output == RHS.Output;<br>
+ }<br>
};<br>
<br>
/// Interface for compilation databases.<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>