diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/ClangTidy.cpp')
| -rw-r--r-- | clang-tools-extra/clang-tidy/ClangTidy.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp index e107e8a2d97..75aaefd56a1 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -197,10 +197,14 @@ public: continue; } StringRef Code = Buffer.get()->getBuffer(); - format::FormatStyle Style = format::getStyle("file", File, FormatStyle); + auto Style = format::getStyle("file", File, FormatStyle); + if (!Style) { + llvm::errs() << llvm::toString(Style.takeError()) << "\n"; + continue; + } llvm::Expected<Replacements> CleanReplacements = format::cleanupAroundReplacements(Code, FileAndReplacements.second, - Style); + *Style); if (!CleanReplacements) { llvm::errs() << llvm::toString(CleanReplacements.takeError()) << "\n"; continue; |

