[clang] [clang] Adjust TextDiagnostic style ranges for interesting source region (PR #164941)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 2 22:09:15 PST 2025


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/164941 at github.com>


================
@@ -1391,6 +1421,12 @@ void TextDiagnostic::emitSnippetAndCaret(
       OS.indent(MaxLineNoDisplayWidth + 2) << "| ";
   };
 
+  Columns MessageLength = DiagOpts.MessageLength;
+
+  // If we don't have enough columns available, just abort now.
+  if (MessageLength != 0 && MessageLength <= Columns(MaxLineNoDisplayWidth + 4))
+    return;
----------------
tbaederr wrote:

Sure but that seems out of scope for this test since we're testing the behavior with 1 and 8 in the tests.

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


More information about the cfe-commits mailing list