<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 16, 2018 at 12:08 PM Roman Lebedev via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">lebedev.ri added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D45685#1069040" rel="noreferrer" target="_blank">https://reviews.llvm.org/D45685#1069040</a>, @dblaikie wrote:<br>
<br>
> I'm not sure this is a practical direction to pursue - though perhaps<br>
>  others disagree.<br>
<br>
<br>
<br>
<br>
> It's likely non-trivial to plumb a flag through most build systems to be<br>
>  applied only to test code<br>
<br>
I'm sorry, I don't understand.<br>
<br>
If you don't separate between source code and `*_test.cpp` sources, sure,<br>
you will loose the warning coverage either way.<br>
<br>
What difference is there between passing `-wtest` and passing `-Wno-self-assign-overloaded`?<br></blockquote><div><br>Not much, if any.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Just pass it alongside with the googletest include paths so to speak.<br></blockquote><div><br>But build systems don't necessarily expose that kind of ability. (For example, googletest (not the only kind of test suite/code) is checked into the LLVM codebase like another library - so depending on it is just another library dependency, not a special "test" library dependency).<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> (& likely would suppress the warning in headers<br>
>  only included in test code - so for example, in a header-only library if<br>
>  the user ran their tests they wouldn't see the warning, but when the users<br>
>  code was used in some other production code it might warn (& possibly break<br>
>  the build if -Werror is in use))<br>
<br>
Could you please explain how it is not an issue if this would be a `-Wno-self-assign-overloaded`?<br></blockquote><div><br>It isn't any different - though it sounds like "-wtest" is being proposed as a way that test code could specifically be corrected without impacting the rest of the code. I'm not sure that's true/viable/accessible to most developers, so the justification seems a bit infeasible - likely naming it -Wno-self-assign-overloaded would at least name it how it'll be used, to turn the warning off across a whole codebase because the false positive rate across the whole codebase is unacceptable for a given user.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Repository:<br>
  rC Clang<br>
<br>
<a href="https://reviews.llvm.org/D45685" rel="noreferrer" target="_blank">https://reviews.llvm.org/D45685</a><br>
<br>
<br>
<br>
</blockquote></div></div>