On Mon, Apr 16, 2018 at 12:08 PM Roman Lebedev via Phabricator < revi...@reviews.llvm.org> wrote:
> lebedev.ri added a comment. > > In https://reviews.llvm.org/D45685#1069040, @dblaikie wrote: > > > I'm not sure this is a practical direction to pursue - though perhaps > > others disagree. > > > > > > It's likely non-trivial to plumb a flag through most build systems to be > > applied only to test code > > I'm sorry, I don't understand. > > If you don't separate between source code and `*_test.cpp` sources, sure, > you will loose the warning coverage either way. > > What difference is there between passing `-wtest` and passing > `-Wno-self-assign-overloaded`? > Not much, if any. > Just pass it alongside with the googletest include paths so to speak. > 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). > > > (& likely would suppress the warning in headers > > only included in test code - so for example, in a header-only library if > > the user ran their tests they wouldn't see the warning, but when the > users > > code was used in some other production code it might warn (& possibly > break > > the build if -Werror is in use)) > > Could you please explain how it is not an issue if this would be a > `-Wno-self-assign-overloaded`? > 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. > > > Repository: > rC Clang > > https://reviews.llvm.org/D45685 > > > >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits