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

Corey Lucier via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 19 11:34:09 PDT 2018


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.

Is there any current mechanism to allow for class member declaration alignment and validation?

Best,

Corey L.






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


More information about the cfe-dev mailing list