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
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/
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:
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;
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))
+
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:
>
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:
>
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
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:
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
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
11 matches
Mail list logo