]> granicus.if.org Git - clang/commit
[clang-format] Break before a sequence of line comments aligned with the next line.
authorKrasimir Georgiev <krasimir@google.com>
Wed, 8 Feb 2017 10:30:44 +0000 (10:30 +0000)
committerKrasimir Georgiev <krasimir@google.com>
Wed, 8 Feb 2017 10:30:44 +0000 (10:30 +0000)
commit889b614d5b0a011dfde79aa55a55fdecb5ef269b
treee9eb2d459ea249fb80d77ebc2f61e110d6774c5e
parent477c05d8f9a58bf89d6c59088dcfcdf0fff766ba
[clang-format] Break before a sequence of line comments aligned with the next line.

Summary:
Make the comment alignment respect sections of line comments originally alinged
with the next token. Until now the decision how to break a continuous sequence
of line comments into sections was taken without reference to the next token.

source:
```
class A {
public: // comment about public
  // comment about a
  int a;
}
```

format before:
```
class A {
public: // comment about public
        // comment about a
  int a;
}
```

format after:
```
class A {
public: // comment about public
  // comment about a
  int a;
}
```

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: cfe-commits, klimek

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

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