]> granicus.if.org Git - clang/commit
[clang-format] Fix FixNamespaceComments when BraceWrapping AfterNamespace is true.
authorMarek Kurdej <marek.kurdej@gmail.com>
Wed, 27 Sep 2017 07:51:51 +0000 (07:51 +0000)
committerMarek Kurdej <marek.kurdej@gmail.com>
Wed, 27 Sep 2017 07:51:51 +0000 (07:51 +0000)
commit87f8a624e795c3810f76316b7afb62986976970b
treeaf4843fee9b66304b59ef4fb98ffb2dbac1df932
parentb7eb46b39c7adc55049d24418f657a883461c1db
[clang-format] Fix FixNamespaceComments when BraceWrapping AfterNamespace is true.

Summary:
NamespaceEndCommentsFixer did not fix namespace comments when the brace opening the namespace was not on the same line as the "namespace" keyword.
It occurs in Allman, GNU and Linux styles and whenever BraceWrapping.AfterNamespace is true.

Before:
```lang=cpp
    namespace a
    {
    void f();
    void g();
    }
```

After:
```lang=cpp
    namespace a
    {
    void f();
    void g();
    } // namespace a
```

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

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