[clang-tools-extra] r217163 - Don't write files with no fixes.

Alexander Kornienko alexfh at google.com
Thu Sep 4 08:19:49 PDT 2014


Author: alexfh
Date: Thu Sep  4 10:19:49 2014
New Revision: 217163

URL: http://llvm.org/viewvc/llvm-project?rev=217163&view=rev
Log:
Don't write files with no fixes.

Modified:
    clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp

Modified: clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp?rev=217163&r1=217162&r2=217163&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp Thu Sep  4 10:19:49 2014
@@ -190,7 +190,7 @@ int main(int argc, const char **argv) {
       OptionsParser.getSourcePathList(), &Errors);
   clang::tidy::handleErrors(Errors, Fix);
 
-  if (!ExportFixes.empty()) {
+  if (!ExportFixes.empty() && !Errors.empty()) {
     std::error_code EC;
     llvm::raw_fd_ostream OS(ExportFixes, EC, llvm::sys::fs::F_None);
     if (EC) {





More information about the cfe-commits mailing list