[clang-tools-extra] [clang-tidy] Fix result check after overwriteChangedFiles() (PR #86360)

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 22 16:39:02 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tidy

Author: Mike Rice (mikerice1969)

<details>
<summary>Changes</summary>

If any return from overwriteChangedFiles is true some fixes were not applied.

---
Full diff: https://github.com/llvm/llvm-project/pull/86360.diff


1 Files Affected:

- (modified) clang-tools-extra/clang-tidy/ClangTidy.cpp (+1-1) 


``````````diff
diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp
index 40ac6918faf407..b877ea06dc05cd 100644
--- a/clang-tools-extra/clang-tidy/ClangTidy.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp
@@ -233,7 +233,7 @@ class ErrorReporter {
         if (!tooling::applyAllReplacements(Replacements.get(), Rewrite)) {
           llvm::errs() << "Can't apply replacements for file " << File << "\n";
         }
-        AnyNotWritten &= Rewrite.overwriteChangedFiles();
+        AnyNotWritten |= Rewrite.overwriteChangedFiles();
       }
 
       if (AnyNotWritten) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/86360


More information about the cfe-commits mailing list