diff options
author | Daniel Jasper <djasper@google.com> | 2014-08-26 09:37:52 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-08-26 09:37:52 +0000 |
commit | 610381ff07c74e3461bfd76e5b8fe0b37365b4bb (patch) | |
tree | 41f35383d736b8acb0021e19972ebcf48465f6fa /clang/lib/Format/FormatToken.h | |
parent | 4919bbe29d04db5e437b90268be9f84594199c37 (diff) | |
download | bcm5719-llvm-610381ff07c74e3461bfd76e5b8fe0b37365b4bb.tar.gz bcm5719-llvm-610381ff07c74e3461bfd76e5b8fe0b37365b4bb.zip |
clang-format: Improve handling of block comments in braced lists.
Before:
std::vector<int> v = {
1, 0 /* comment */
};
After:
std::vector<int> v = {1, 0 /* comment */};
llvm-svn: 216445
Diffstat (limited to 'clang/lib/Format/FormatToken.h')
-rw-r--r-- | clang/lib/Format/FormatToken.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h index 528cab78cc0..38f157776f3 100644 --- a/clang/lib/Format/FormatToken.h +++ b/clang/lib/Format/FormatToken.h @@ -350,7 +350,8 @@ struct FormatToken { } bool isTrailingComment() const { - return is(tok::comment) && (!Next || Next->NewlinesBefore > 0); + return is(tok::comment) && + (Type == TT_LineComment || !Next || Next->NewlinesBefore > 0); } /// \brief Returns \c true if this is a keyword that can be used |