diff options
author | Alexander Kornienko <alexfh@google.com> | 2013-07-16 23:47:22 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2013-07-16 23:47:22 +0000 |
commit | 940423424140fc791f3dc242ea35eab11de925ad (patch) | |
tree | 081ad459a9c777b1f00d4e48bc1da310c47baaeb /clang/lib/Format/Format.cpp | |
parent | 8bfde8917ed77b89fe916854b67352884ffb7b16 (diff) | |
download | bcm5719-llvm-940423424140fc791f3dc242ea35eab11de925ad.tar.gz bcm5719-llvm-940423424140fc791f3dc242ea35eab11de925ad.zip |
Avoid breaking non-trailing block comments.
Motivating example:
// column limit ------------------->
void ffffffffffff(int aaaaaa /* test */);
Formatting before the patch:
void ffffffffffff(int aaaaaa /* test
*/);
Formatting after the patch:
void
ffffffffffff(int aaaaaa /* test */);
llvm-svn: 186471
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r-- | clang/lib/Format/Format.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 11ab58c18cd..125283a0c6d 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -917,7 +917,7 @@ private: Token.reset(new BreakableStringLiteral(Current, StartColumn, Line.InPPDirective, Encoding)); - } else if (Current.Type == TT_BlockComment) { + } else if (Current.Type == TT_BlockComment && Current.isTrailingComment()) { Token.reset(new BreakableBlockComment( Style, Current, StartColumn, OriginalStartColumn, !Current.Previous, Line.InPPDirective, Encoding)); |