[cfe-dev] Clang-format Inquiry - Member Alignment

Owen Pan via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 19 19:04:48 PDT 2018


On Wed, Sep 19, 2018 at 11:34 AM Corey Lucier via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Thank you in advance for any assistance, this is my first cfe-dev list
> post, apologies for any disruption.
>
>
>
> We use clang-format to lint our C++ as well as “auto-fix” as necessary.
>
>
>
> There is one coding convention which we had to lose given the fact that it
> seems clang-format doesn’t have any options we can use to allow for it.
> Specifically C++ class member alignment.
>
>
>
> We want to for example be able to format our class members for easier
> scanning/readability as follows:
>
>
>
> TypeA      m_memberOne;
>
> LongTypeB* m_memberTwo = nullptr;
>
> bool       m_someFlag = false;
>
>
>
> Unfortunately if we for example make use of *AlignConsecutiveDeclarations*
> local method definitions become aligned as well as locally declared
> functions, etc.
>
>
Can you use a code snippet to elaborate what you mean and want here? Are
you referring to member functions defined and declared in the class
declaration, respectively?


>
> Is there any current mechanism to allow for class member declaration
> alignment and validation?
>
>
What does validation mean?

Thanks,
Owen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180919/29577559/attachment.html>


More information about the cfe-dev mailing list