[Lldb-commits] [clang] [clang-tools-extra] [flang] [lldb] [Clang] Refactor and consolidate color diagnostic handling (PR #202441)

Aaron Ballman via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 11 09:11:39 PDT 2026


================
@@ -53,7 +53,7 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags,
 
   Diags.setElideType(Opts.ElideType);
   Diags.setPrintTemplateTree(Opts.ShowTemplateTree);
-  Diags.setShowColors(Opts.ShowColors);
+  Diags.setShowColors(Opts.showColors(/*StreamHasColors=*/true));
----------------
AaronBallman wrote:

I think this change is correct, but maybe we should have test coverage for:

Using `-diagnostic-log-file` to specify a regular file, no options about color
Using `-diagnostic-log-file` to specify a regular file, enable color
Using `-diagnostic-log-file` to specify a terminal, no options about color

so that we can validate that option handling behaves correctly here. WDYT?

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


More information about the lldb-commits mailing list