[PATCH] D121269: [clang-format] Fix namepsace format when the name is after by a macro

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 8 19:04:25 PST 2022


zequanwu created this revision.
zequanwu added reviewers: thakis, MyDeveloperDay, owenpan, klimek, sammccall.
Herald added a project: All.
zequanwu requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121269

Files:
  clang/lib/Format/NamespaceEndCommentsFixer.cpp
  clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121269.413993.patch
Type: text/x-patch
Size: 4395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220309/6be1c067/attachment.bin>


More information about the cfe-commits mailing list