[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 4 20:38:32 PDT 2024


================
@@ -4026,12 +4030,13 @@ Expected<FormatStyle> getStyle(StringRef StyleName, StringRef FileName,
   // Reset possible inheritance
   Style.InheritsParentConfig = false;
 
-  auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {};
+  auto diagHandlerOrDropHandling =
+      DiagHandler ? DiagHandler : [](llvm::SMDiagnostic const &, void *) {};
----------------
owenca wrote:

It seems we can just delete line 4029. See below.

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


More information about the cfe-commits mailing list