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 llvm-svn: 174975
Loading
Please register or sign in to comment