[PATCH] D153205: [clang-format] Add new block type ListInit

Gedare Bloom via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 17 11:32:13 PDT 2023


gedare created this revision.
Herald added projects: All, clang, clang-format.
Herald added a subscriber: cfe-commits.
Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay.
gedare requested review of this revision.

C89 and C90 list initializers are treated differently than Cpp11 braced
initializers. This patch introduces a new block type (BK_ListInit) that
is used to identify the C array/struct initializer lists and to support
formatting rules for BracketAlignmentStyle.BlockIndent applied to them.

Addresses Issue #57878.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153205

Files:
  clang/lib/Format/ContinuationIndenter.cpp
  clang/lib/Format/FormatToken.cpp
  clang/lib/Format/FormatToken.h
  clang/lib/Format/TokenAnnotator.cpp
  clang/lib/Format/UnwrappedLineParser.cpp
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153205.532417.patch
Type: text/x-patch
Size: 10923 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230617/8c4b3b5c/attachment-0001.bin>


More information about the cfe-commits mailing list