[PATCH] D91949: [clang-format] Add BeforeStructInitialization option in BraceWrapping configuration

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 29 12:12:39 PDT 2021


HazardyKnusperkeks added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2705
   }
-  if (FormatTok->Tok.is(tok::l_brace)) {
+  if (FormatTok->Tok.is(tok::equal)) {
+    nextToken();
----------------
MyDeveloperDay wrote:
> shouldn't this be
> 
> ```FormatTok->Tok.is(tok::equal) && Style.BraceWrapping.BeforeStructInitialization```
> 
> Otherwise you won't go into the `else if (FormatTok->Tok.is(tok::l_brace)) {`  if its not turned on?
Is there a test case which would fail without that change? (I think no.) Should there be one? (I think yes!)


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

https://reviews.llvm.org/D91949



More information about the cfe-commits mailing list