diff options
author | Daniel Jasper <djasper@google.com> | 2013-02-04 07:32:14 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-02-04 07:32:14 +0000 |
commit | 2752ff35854b295837b8088e44d5a932be60e107 (patch) | |
tree | 14651849ce8cd0a36f00d0e8eaa2879f6cb718fd /lib/Format/Format.cpp | |
parent | 8159d2f271c9142b46a672ac2c45821911171a7d (diff) |
Improve handling of trailing block comments.
We can now (even in non-bin-packing modes) format:
someFunction(1, /* comment 1 */
2, /* comment 2 */
3, /* comment 3 */
aaa);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174309 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r-- | lib/Format/Format.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 2f14fc0ce1..91cbc2efcd 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -690,7 +690,8 @@ private: return true; if (State.NextToken->Parent->is(tok::comma) && State.Stack.back().BreakAfterComma && - State.NextToken->Type != TT_LineComment) + (State.NextToken->isNot(tok::comment) || + !State.NextToken->Children[0].MustBreakBefore)) return true; if ((State.NextToken->Type == TT_CtorInitializerColon || (State.NextToken->Parent->ClosesTemplateDeclaration && |