[clang] [clang-format] Skip conditional branch tracking inside unreachable #if blocks (PR #232156)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 23 11:49:49 PDT 2026


================
@@ -7020,6 +7020,43 @@ TEST_F(FormatTest, FormatsJoinedLinesOnSubsequentRuns) {
                SingleLine);
 }
 
+TEST_F(FormatTest, DeeplyNestedPreprocessorConditionals) {
+  std::string Input;
+  std::string Expected;
+  constexpr unsigned Depth = 20;
+  for (unsigned I = 0; I < Depth; ++I) {
----------------
HazardyKnusperkeks wrote:

I understand what you intend to do here, but that's hardly readable. Since you already use AI, can't you just create the strings as literals?
Would improve readability and runtime.

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


More information about the cfe-commits mailing list