[PATCH] D21279: Fix some issues in clang-format's AlignConsecutive modes

Ben Harper via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 20 13:26:21 PDT 2016


bmharper added a comment.

I've taken some time to investigate those two issues, and these are my thoughts:

1. Constructor alignment: I think this is a good thing to do, but if `isFunctionDeclarationName`, and it's caller `TokenAnnotator::calculateFormattingInformation` are anything to go by, adding support for detection of constructors is going to be pretty hairy. I think I can see a way to do it, but it involves adding yet more complexity to `TokenAnnotator::calculateFormattingInformation`, and I'm not sure it's worth the effort. See TokenAnnotator.cpp <https://github.com/llvm-mirror/clang/blob/master/lib/Format/TokenAnnotator.cpp#L1677> for reference.

2. friend functions: I don't really understand why the current behavior is what it is, but I think it's reasonable to argue that it actually improves readability by drawing attention to the fact these are friend functions, which ought to be quite rare in most code


Repository:
  rL LLVM

http://reviews.llvm.org/D21279





More information about the cfe-commits mailing list