aaron.ballman added a comment. Thank you for working on this!
================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp:10 +bool tryToExtinguish(bool&); +bool tryToExtinguishByVal(bool &); void tryPutFireOut(); ---------------- Did you mean for the parameter to be a reference? ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp:963 + if (tryToExtinguishByVal(isSet) && isSet) { + if (tryToExtinguishByVal(isSet) && isSet) { + // NO-MESSAGE: fire may have been extinguished ---------------- FWIW, I would expect this one to be diagnosed if the call really was byval instead of byref. ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp:968 + } +} + ---------------- Another test that would be interesting is: ``` if (tryToExtinguish(isSet) && isSet) { if (tryToExtinguishByVal(isSet) && isSet) { // Dupe check of isSet should be diagnosed scream(); } } if (tryToExtinguishByVal(isSet) && isSet) { if (tryToExtinguish(isSet) && isSet) { // Ok scream(); } } ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91495/new/ https://reviews.llvm.org/D91495 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits