avogelsgesang added inline comments.

================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/readability-container-contains.cpp:189
+    // NO-WARNING.
+    // CHECK-FIXES: if (MyMap.count(0))
+    return nullptr;
----------------
whisperity wrote:
> If a fix is not generated, why is this line here?
I added this test expectation to make sure that the line is kept unchanged. 

I followed 
https://clang.llvm.org/extra/clang-tidy/Contributing.html#testing-checks:

> In particular, CHECK-FIXES: can be used to check that code was not modified 
> by fix-its, by checking that it is present unchanged in the fixed code.

Based on this, I thought it is best practice to also check that places which I 
expect to stay unmodified are actually left unmodified. But I am not sure what 
the expectations in the clang-tidy code base are and whether those "the code 
stays unmodified" checks are actually encouraged or discouraged.
So just say the word and I am happy to remove this test expectation...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112646/new/

https://reviews.llvm.org/D112646

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to