[clang] [clang][Diagnostics] Make 'note' color CYAN (PR #66997)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 27 02:04:16 PDT 2023


https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/66997

>From 8d7c79946f8afecf3313bcccbb5b45133242bf8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Thu, 21 Sep 2023 12:01:30 +0200
Subject: [PATCH] [clang][Diagnostics] Make 'note' color CYAN

Just using BLACK makes it invisible in terminals with a dark background.
---
 clang/docs/ReleaseNotes.rst           | 2 ++
 clang/lib/Frontend/TextDiagnostic.cpp | 3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 7abcb8d799e09dc..f227c05e76f0702 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -204,6 +204,8 @@ Improvements to Clang's diagnostics
 - Clang no longer emits irrelevant notes about unsatisfied constraint expressions
   on the left-hand side of ``||`` when the right-hand side constraint is satisfied.
   (`#54678: <https://github.com/llvm/llvm-project/issues/54678>`_).
+- Clang now prints its 'note' diagnostic in cyan instead of black, to be more compatible
+  with terminals with dark background colors. This is also more consistent with GCC.
 
 Bug Fixes in This Version
 -------------------------
diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp
index eaa6e8d29a1dece..779dead5d058d1a 100644
--- a/clang/lib/Frontend/TextDiagnostic.cpp
+++ b/clang/lib/Frontend/TextDiagnostic.cpp
@@ -24,8 +24,7 @@
 
 using namespace clang;
 
-static const enum raw_ostream::Colors noteColor =
-  raw_ostream::BLACK;
+static const enum raw_ostream::Colors noteColor = raw_ostream::CYAN;
 static const enum raw_ostream::Colors remarkColor =
   raw_ostream::BLUE;
 static const enum raw_ostream::Colors fixitColor =



More information about the cfe-commits mailing list