[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)
commitcaf6fd51eee1eb2103b25ad006dc12af8606eb70
tree013d6c4650325a4b6db6bdfdb6cc578ba6daeadb
parentde4806d321d0c1e075277656586d540c0476b4fe
[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

llvm-svn: 314279
clang/lib/Format/NamespaceEndCommentsFixer.cpp
clang/unittests/Format/FormatTest.cpp