[PATCH] D120931: [clang-format] fix namepsace format when the name is macro expansion

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 3 16:08:27 PST 2022


zequanwu added inline comments.


================
Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:86
+            "int j;\n"
+            "}// namespace A::M",
+            fixNamespaceEndComments("#define M(x) x##x\n"
----------------
MyDeveloperDay wrote:
> same here its not A::M is it? at best its A::x but it depends on the macro ? or have I miss understood?
Yes, you are right. Fixed to include the macro literally. 
Ideally, it should expand the macro to get the name or ignore the macro. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120931/new/

https://reviews.llvm.org/D120931



More information about the cfe-commits mailing list