]> granicus.if.org Git - clang/commit
[clang-format] Fix regression that breaks comments without a comment prefix
authorKrasimir Georgiev <krasimir@google.com>
Mon, 30 Jan 2017 21:00:01 +0000 (21:00 +0000)
committerKrasimir Georgiev <krasimir@google.com>
Mon, 30 Jan 2017 21:00:01 +0000 (21:00 +0000)
commit0c253cbb071830e650a6c9344fc0ca3b913db332
treebdaa9c94a70e67afc144f7dd3f795e5b59c4a989
parentb4b0b5984b0819a390d74e4c293c808760511ab5
[clang-format] Fix regression that breaks comments without a comment prefix

Summary:
Consider formatting the following code fragment with column limit 20:
```
{
  // line 1
  // line 2\
  // long long long line
}
```
Before this fix the output is:
```
{
  // line 1
  // line 2\
  // long long
  long line
}
```
This patch fixes a regression that breaks the last comment line without
adding the '//' prefix.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D29298

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293548 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/BreakableToken.cpp
unittests/Format/FormatTest.cpp