[PATCH] D153205: [clang-format] Support block indenting array/struct list initializers

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 14:02:52 PDT 2023


owenpan added inline comments.


================
Comment at: clang/include/clang/Format/Format.h:95-98
     /// \warning
-    ///  Note: This currently only applies to parentheses.
+    ///  Note: This currently only applies to parentheses and braced list
+    ///  initializers when ``Cpp11BracedListStyle`` is ``True``.
     /// \endwarning
----------------



================
Comment at: clang/lib/Format/FormatToken.cpp:79-81
+  if (isNot(tok::r_brace))
+    return false;
+  if (Style.Cpp11BracedListStyle != true ||
----------------



================
Comment at: clang/lib/Format/FormatToken.cpp:85-86
+  }
+  auto LBrace = MatchingParen;
+  assert(LBrace);
+  if (LBrace->is(BK_BracedInit))
----------------



================
Comment at: clang/unittests/Format/FormatTest.cpp:25519
+               "    .baz = \"zzzzzzzzzzzzz\"\n"
+               "};\n",
+               Style);
----------------
Ditto below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153205



More information about the cfe-commits mailing list