[PATCH] D148467: [clang-format] Add a new AfterCSharpProperty to BraceWrapping

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 17 15:54:26 PDT 2023


owenpan added inline comments.


================
Comment at: clang/include/clang/Format/Format.h:1220
+    /// \endcode
+    bool AfterCSharpProperty;
   };
----------------
MyDeveloperDay wrote:
> HazardyKnusperkeks wrote:
> > MyDeveloperDay wrote:
> > > HazardyKnusperkeks wrote:
> > > > Please sort. :)
> > > Are we sure we want THIS to be alphabetic, as this changes the initializer order, if someone is using the format() library in downstream code this could subtly break them?
> > > 
> > > ```
> > > Expanded.BraceWrapping = {/*AfterCaseLabel=*/false,
> > >                             /*AfterClass=*/false,
> > >                             /*AfterControlStatement=*/FormatStyle::BWACS_Never,
> > >                             /*AfterEnum=*/false,
> > >                             /*AfterFunction=*/false,
> > >                             /*AfterNamespace=*/false,
> > >                             /*AfterObjCDeclaration=*/false,
> > >                             /*AfterStruct=*/false,
> > >                             /*AfterUnion=*/false,
> > >                             /*AfterExternBlock=*/false,
> > >                             /*BeforeCatch=*/false,
> > >                             /*BeforeElse=*/false,
> > >                             /*BeforeLambdaBody=*/false,
> > >                             /*BeforeWhile=*/false,
> > >                             /*IndentBraces=*/false,
> > >                             /*SplitEmptyFunction=*/true,
> > >                             /*SplitEmptyRecord=*/true,
> > >                             /*SplitEmptyNamespace=*/true,
> > >                             /*AfterCSharpProperty=*/false};
> > > ```
> > I'd say yes, we are breaking this stuff always.
> > 
> > Granted this one may compile without an error, but they should get a warning of a missing initializer.
> > 
> > You could add a constructor to initialize out of struct order.
> I'm ok with making the change, just wanted to double check that we are ok to break the ordering.
I kept them sorted in D52527 years ago. :)


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

https://reviews.llvm.org/D148467



More information about the cfe-commits mailing list