owenpan updated this revision to Diff 422335. owenpan added a comment. Updated the affected clang test.
CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123535/new/ https://reviews.llvm.org/D123535 Files: clang/lib/Format/Format.cpp clang/test/Format/style-on-command-line.cpp Index: clang/test/Format/style-on-command-line.cpp =================================================================== --- clang/test/Format/style-on-command-line.cpp +++ clang/test/Format/style-on-command-line.cpp @@ -6,7 +6,7 @@ // RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %t/.clang-format // RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK5 %s // RUN: printf "\n" > %t/.clang-format -// RUN: not clang-format -style=file -fallback-style=webkit -assume-filename=%t/foo.cpp < %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK6 %s +// RUN: clang-format -style=file -fallback-style=webkit -assume-filename=%t/foo.cpp < %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK6 %s // RUN: rm %t/.clang-format // RUN: printf "BasedOnStyle: google\nIndentWidth: 6\n" > %t/_clang-format // RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK7 %s Index: clang/lib/Format/Format.cpp =================================================================== --- clang/lib/Format/Format.cpp +++ clang/lib/Format/Format.cpp @@ -1722,7 +1722,7 @@ FormatStyle::LanguageKind Language = Style->Language; assert(Language != FormatStyle::LK_None); if (Config.getBuffer().trim().empty()) - return make_error_code(ParseError::Error); + return make_error_code(ParseError::Success); Style->StyleSet.Clear(); std::vector<FormatStyle> Styles; llvm::yaml::Input Input(Config, /*Ctxt=*/nullptr, DiagHandler,
Index: clang/test/Format/style-on-command-line.cpp =================================================================== --- clang/test/Format/style-on-command-line.cpp +++ clang/test/Format/style-on-command-line.cpp @@ -6,7 +6,7 @@ // RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %t/.clang-format // RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK5 %s // RUN: printf "\n" > %t/.clang-format -// RUN: not clang-format -style=file -fallback-style=webkit -assume-filename=%t/foo.cpp < %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK6 %s +// RUN: clang-format -style=file -fallback-style=webkit -assume-filename=%t/foo.cpp < %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK6 %s // RUN: rm %t/.clang-format // RUN: printf "BasedOnStyle: google\nIndentWidth: 6\n" > %t/_clang-format // RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK7 %s Index: clang/lib/Format/Format.cpp =================================================================== --- clang/lib/Format/Format.cpp +++ clang/lib/Format/Format.cpp @@ -1722,7 +1722,7 @@ FormatStyle::LanguageKind Language = Style->Language; assert(Language != FormatStyle::LK_None); if (Config.getBuffer().trim().empty()) - return make_error_code(ParseError::Error); + return make_error_code(ParseError::Success); Style->StyleSet.Clear(); std::vector<FormatStyle> Styles; llvm::yaml::Input Input(Config, /*Ctxt=*/nullptr, DiagHandler,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits