[PATCH] D88239: [clang-format] Fix spaces around */& in multi-variable declarations

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 27 15:25:17 PDT 2020


djasper added a comment.

Sorry for being a bit late here and thanks @klimek for bringing this to my attention.
This has been years ago, but if I reconstruct my thinking (and look at the test cases), then I'd say that "left" alignment should not be applied to multi-variable decl statements ever.

  int* a, b;

Just looks too much like it's declaring two int pointers when it is not. And it leads to all sorts of weirdness when doing line wrapping.
So, I'd really like to keep the current behavior.
If you'd want to change it because it makes a difference for someone's codebase, I'd almost lean towards introducing an additional PointerAlignmentStyle PAS_LeftEvenForMutliVarDeclStatements :).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88239/new/

https://reviews.llvm.org/D88239



More information about the cfe-commits mailing list