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

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 15:19:48 PST 2018


djasper added a comment.

While I agree that there is probably a bug to fix, I don't (yet) agree with what is proposed in this patch. I think a comment in between preprocessor directives should always either:

- Be considered part of the code in between the #-lines
- Be considered to be commenting on the subsequent #-line

In the former case, we need to indent with the regular IndentWidth, completely irrespective of anything inside the preprocessor lines. In the latter case, we should align with the # in column 0. To me, aligning with the define seems fundamentally wrong.


Repository:
  rC Clang

https://reviews.llvm.org/D42036





More information about the cfe-commits mailing list