diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-02-12 16:17:07 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-02-12 16:17:07 +0000 |
commit | 95e8e468af284afb11ec1f994d0b5076fc7423d9 (patch) | |
tree | e1b3aa02c91880f03e29e24b92d0e5b47f01a307 /lib/Format/Format.cpp | |
parent | 7f43fcf5d9406788ce95c9f3b785e0a6bc75a7f7 (diff) |
Formatter: Correctly format stars in `sizeof(int**)` and similar places.
This redoes how '*' and '&' are classified as pointer / reference markers when
followed by ')', '>', or ','.
Previously, determineStarAmpUsage() marked a single '*' and '&' followed by
')', '>', or ',' as pointer or reference marker. Now, all '*'s and '&'s
preceding ')', '>', or ',' are marked as pointer / reference markers. Fixes
PR14884.
Since only the last '*' in 'int ***' was marked as pointer before (the rest
were unary operators, which don't reach spaceRequiredBetween()),
spaceRequiredBetween() now had to be thought about handing multiple '*'s in
sequence.
Before:
return sizeof(int * *);
Type **A = static_cast<Type * *>(P);
Now:
return sizeof(int**);
Type **A = static_cast<Type **>(P);
While here, also make all methods of AnnotatingParser except parseLine()
private.
Review URL: http://llvm-reviews.chandlerc.com/D384
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
0 files changed, 0 insertions, 0 deletions