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

Alexander Richardson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 24 09:20:35 PDT 2020


arichardson created this revision.
arichardson added reviewers: JakeMerdichAMD, MyDeveloperDay.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
arichardson requested review of this revision.

While writing tests for D88227 <https://reviews.llvm.org/D88227>, I noticed that multi-variable declarations
such as `SomeType *qualified *a = NULL, *const *b;` were being formatted
weirdly for Left and Middle pointer alignment. This change attempts to make
this more consistent and ensures there is always a space between the */&
and the variable name.

Before (with PAS_Left):
SomeType * const *a = NULL, * const *b;
After:
SomeType* const* a = NULL, * const* b;


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88239

Files:
  clang/lib/Format/TokenAnnotator.cpp
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88239.294089.patch
Type: text/x-patch
Size: 5195 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200924/9bb56a29/attachment.bin>


More information about the cfe-commits mailing list