[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread Zequan Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGbe5705767aad: [clang-format] fix namepsace format when the name is macro expansion (authored by zequanwu). Repository: rG LLVM Github Monorepo

[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. This revision is now accepted and ready to land. LGTM, but please wait for other reviewers in case they have more comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120931/new/

[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 413139. zequanwu marked 2 inline comments as done. zequanwu added a comment. update. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120931/new/ https://reviews.llvm.org/D120931 Files:

[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:59-60 + +// Use the string after `namespace` until `{` or `::` or `(` as a name +// candidate. If the name is empty, use the candicate. +std::string FirstNSName;

[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:45-54 + int NestLevel = 1; + while (Tok && NestLevel > 0) { +Tok = Tok->getNextNonComment(); +if (Tok) { + if (Tok->is(tok::l_square)) +

[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added inline comments. Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:112 + EXPECT_EQ("#define M(x) x##x\n" +"namespace [[deprecated(\"foo\")]] A::inline M(x)::A {\n" +"int i;\n" MyDeveloperDay wrote: >

[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:112 + EXPECT_EQ("#define M(x) x##x\n" +"namespace [[deprecated(\"foo\")]] A::inline M(x)::A {\n" +"int i;\n" zequanwu wrote: >

[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added inline comments. Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:112 + EXPECT_EQ("#define M(x) x##x\n" +"namespace [[deprecated(\"foo\")]] A::inline M(x)::A {\n" +"int i;\n" MyDeveloperDay wrote: > Is

[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 413109. zequanwu marked 4 inline comments as done. zequanwu added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120931/new/ https://reviews.llvm.org/D120931 Files:

[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. > Its assignment only happens in MacroExpander which is never used This is something that @klimek was working on. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120931/new/ https://reviews.llvm.org/D120931

[PATCH] D120931: [clang-format] Fix namespace format when the name is a macro expansion

2022-03-04 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:112 + EXPECT_EQ("#define M(x) x##x\n" +"namespace [[deprecated(\"foo\")]] A::inline M(x)::A {\n" +"int i;\n" Is this 2 bugs in