[all-commits] [llvm/llvm-project] d54c4d: [clang-format] Fix namespace format when the name ...

Zequan Wu via All-commits all-commits at lists.llvm.org
Thu Mar 10 15:00:45 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d54c4df31470044a66605ebb8a2f936e8dd552af
      https://github.com/llvm/llvm-project/commit/d54c4df31470044a66605ebb8a2f936e8dd552af
  Author: Zequan Wu <zequanwu at google.com>
  Date:   2022-03-10 (Thu, 10 Mar 2022)

  Changed paths:
    M clang/lib/Format/NamespaceEndCommentsFixer.cpp
    M clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp

  Log Message:
  -----------
  [clang-format] Fix namespace format when the name is followed by a macro

Example:
```
$ cat a.cpp
namespace my_namespace::yeah API_AVAILABLE(macos(10.15)) {
void test() {}
}

$ clang-format a.cpp
namespace my_namespace::yeah API_AVAILABLE(macos(10.15)) {
void test() {}
}// namespace my_namespace::yeahAPI_AVAILABLE(macos(10.15))
```
After:
```
$ clang-format a.cpp
namespace my_namespace::yeah API_AVAILABLE(macos(10.15)) {
void test() {}
}// namespace my_namespace::yeah
```

Reviewed By: MyDeveloperDay, owenpan, curdeius

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




More information about the All-commits mailing list