[PATCH] D42036: [clang-format] Keep comments aligned to macros

Mark Zeren via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 07:21:11 PST 2018


mzeren-vmw added a comment.

In https://reviews.llvm.org/D42036#976827, @klimek wrote:

> Just from a formatting point of view, why not:
>
>   //.   Comment
>   #.    define X


(assuming the '.'s are unintentional)
There is some logic in placing `//` in column 0, since we place `#` in column 0. However, we do not have examples of that style in our code base.  We do have examples of aligning `//` above define:

     // Comment
  #  define

Are you suggesting that c-f manage the indent after the `//` (or `///`, etc.)? This seems more complex than managing the space between `#` and `<directive>`. I do want c-f to be able to re-indent aligned comments if an `#if` is inserted above.


Repository:
  rC Clang

https://reviews.llvm.org/D42036





More information about the cfe-commits mailing list