forked from OSchip/llvm-project
clang-format: Only special-case top-level */& in multivar-declstmts.
Before (even with PointerAlignment: Left): vector<int *> a, b; After: vector<int*> a, b; llvm-svn: 282410
This commit is contained in:
parent
160572855d
commit
3f2cde91d8
|
@ -2015,7 +2015,7 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
|
|||
Left.Previous->is(tok::r_paren)) ||
|
||||
(!Left.isOneOf(TT_PointerOrReference, tok::l_paren) &&
|
||||
(Style.PointerAlignment != FormatStyle::PAS_Left ||
|
||||
Line.IsMultiVariableDeclStmt)));
|
||||
(Line.IsMultiVariableDeclStmt && Left.NestingLevel == 0))));
|
||||
if (Right.is(TT_FunctionTypeLParen) && Left.isNot(tok::l_paren) &&
|
||||
(!Left.is(TT_PointerOrReference) ||
|
||||
(Style.PointerAlignment != FormatStyle::PAS_Right &&
|
||||
|
|
|
@ -4802,6 +4802,7 @@ TEST_F(FormatTest, DeclarationsOfMultipleVariables) {
|
|||
verifyFormat("aaaaaaaaa *a = aaaaaaaaaaaaaaaaaaa, *b = bbbbbbbbbbbbbbbbbbb,\n"
|
||||
" *b = bbbbbbbbbbbbbbbbbbb, *d = ddddddddddddddddddd;",
|
||||
Style);
|
||||
verifyFormat("vector<int*> a, b;", Style);
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, ConditionalExpressionsInBrackets) {
|
||||
|
|
Loading…
Reference in New Issue