[PATCH] D150403: [clang-format] Adjust braced list detection (try 2)

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 12 13:02:52 PDT 2023


HazardyKnusperkeks added a comment.

Shouldn't it have token annotator tests?



================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:495-496
   SmallVector<FormatToken *, 8> LBraceStack;
+  // Track the previous token type corresponding to our lbraces // to help
+  // detect brace types
+  SmallVector<tok::TokenKind, 8> PrevTokenKindStack;
----------------



================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:580-581
+
+          // Distinguish between braced list in a constructor initializer list
+          // followed by constructor body, or just adjacent blocks
+          ProbablyBracedList = ProbablyBracedList ||
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150403/new/

https://reviews.llvm.org/D150403



More information about the cfe-commits mailing list