[PATCH] D68296: [clang-format] Add ability to wrap braces after multi-line control statements

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 2 14:24:17 PDT 2019


MyDeveloperDay accepted this revision.
MyDeveloperDay added a comment.
This revision is now accepted and ready to land.

LGTM and Thank you.



================
Comment at: clang/lib/Format/Format.cpp:643
+                            true};
   switch (Style.BreakBeforeBraces) {
   case FormatStyle::BS_Linux:
----------------
mitchell-stellar wrote:
> MyDeveloperDay wrote:
> > Nit: this a drive by comment, but I feel this is really hard to read.. and not something that needs to be done in this revision but this feels like it needs to be formatted differently
> > 
> > {
> > /*AfterClass=*/false,
> > /*AfterEnum=*/false
> > /*AfterControlStatement=*/FormatStyle::BWACS_Never,
> > .....
> > }
> > 
> > because without going back and checking that the AfterControl statement is the 3rd bool I simply can't see what is on and what is off.
> I'm going to leave this as-is, because before, I was still forced to look-up what each `true` or `false` value was assigned to.
that's fine, it's always the problem with comments they can also get out of date, to be honest, if every element was an enum then it would be:

```
{
FormatStyle::BWAC::Never,
FormatStyle::BWAE::Never,
.....
```

and when the structure changes the compiler would tell us if we had it wrong, but thats for another time, your enum will help begin that process.


Repository:
  rC Clang

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

https://reviews.llvm.org/D68296





More information about the cfe-commits mailing list