diff options
| author | Daniel Jasper <djasper@google.com> | 2016-01-04 07:30:44 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2016-01-04 07:30:44 +0000 |
| commit | 55582073e4b54215213b7a85607ad7c1e2ac44a2 (patch) | |
| tree | 5dcc9718e0915d0e4a560801e103538e3f8006ef /clang/lib | |
| parent | 9c8a774c4804e3379e76f6846e3aa0fa912d96a9 (diff) | |
| download | bcm5719-llvm-55582073e4b54215213b7a85607ad7c1e2ac44a2.tar.gz bcm5719-llvm-55582073e4b54215213b7a85607ad7c1e2ac44a2.zip | |
clang-format: Align long braced init lists even if they are nested in
function calls.
llvm-svn: 256740
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/FormatToken.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Format/FormatToken.cpp b/clang/lib/Format/FormatToken.cpp index 63af0d6088d..d6cd450d892 100644 --- a/clang/lib/Format/FormatToken.cpp +++ b/clang/lib/Format/FormatToken.cpp @@ -218,10 +218,12 @@ void CommaSeparatedList::precomputeFormattingInfos(const FormatToken *Token) { ItemBegin = ItemEnd->Next; } - // Don't use column layout for nested lists, lists with few elements and in - // presence of separating comments. - if ((Token->NestingLevel != 0 && Token->is(tok::l_brace)) || - Commas.size() < 5 || HasSeparatingComment) + // Don't use column layout for lists with few elements and in presence of + // separating comments. + if (Commas.size() < 5 || HasSeparatingComment) + return; + + if (Token->NestingLevel != 0 && Token->is(tok::l_brace) && Commas.size() < 19) return; // We can never place more than ColumnLimit / 3 items in a row (because of the |

