[clang-format] Fix AlignConsecutiveDeclarations handling of pointers
authorDarwin Xu <darwin.xu@icloud.com>
Sat, 27 Feb 2021 21:40:57 +0000 (22:40 +0100)
committerBjörn Schäpers <bjoern@hazardy.de>
Sat, 27 Feb 2021 21:56:36 +0000 (22:56 +0100)
commite0b1df924ae06d6d88582334087d2eacc6702e8f
tree8ff38106bba1af79a070348cec50c541351c6c43
parent6f9dd843db4096cb3a63ce55e3f144e52dcaa98e
[clang-format] Fix AlignConsecutiveDeclarations handling of pointers

This is a bug fix of https://bugs.llvm.org/show_bug.cgi?id=49175

The expected code format:

unsigned int*       a;
int*                b;
unsigned int Const* c;

The actual code after formatting (without this patch):

unsigned int* a;
int*          b;
unsigned int Const* c;

Differential Revision: https://reviews.llvm.org/D97137
clang/lib/Format/WhitespaceManager.cpp
clang/unittests/Format/FormatTest.cpp