This revision was automatically updated to reflect the committed changes.
Closed by commit rGd54c4df31470: [clang-format] Fix namespace format when the
name is followed by a macro (authored by zequanwu).
Changed prior to commit:
https://reviews.llvm.org/D121269?vs=414442&id=414506#toc
Reposito
owenpan accepted this revision.
owenpan added inline comments.
Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:108
+ // which one is name. For example, `namespace A B {`.
+ while (Tok && !Tok->is(tok::l_brace)) {
+if (FirstNSTok) {
===
zequanwu updated this revision to Diff 414442.
zequanwu marked 7 inline comments as done.
zequanwu added a comment.
Address comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121269/new/
https://reviews.llvm.org/D121269
Files:
clang/lib/For
owenpan added inline comments.
Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:33
+ llvm::function_ref Fn) {
+ if (!Tok || !Tok->is(StartTok))
+return Tok;
And other places below where applicable.
Comment at: clang/
curdeius accepted this revision.
curdeius added a comment.
LGTM % nits. Thanks for working on this!
Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:54-55
+Tok = processTokens(Tok, tok::l_paren, tok::r_paren, nullptr);
+ } else if (Tok->is(tok::l_square))
+To
zequanwu updated this revision to Diff 414222.
zequanwu marked 2 inline comments as done.
zequanwu added a comment.
Refactor.
Add a test for `namespace A __attribute__((availability(macos,
introduced=10.15))) {`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews
curdeius added inline comments.
Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:192
"}"));
+ EXPECT_EQ("#define M(x) x##x\n"
+"namespace A M(x) {\n"
curdeius wrote:
> zequanwu wrote:
> > zequanwu wrote:
> > > cur
curdeius added inline comments.
Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:72
-Tok = FirstNSTok;
-while (Tok && !Tok->is(tok::l_brace)) {
+bool IsPrevColoncolon = false;
+bool HasColoncolon = false;
Nit: Personally, I'd put these
zequanwu added inline comments.
Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:192
"}"));
+ EXPECT_EQ("#define M(x) x##x\n"
+"namespace A M(x) {\n"
zequanwu wrote:
> curdeius wrote:
> > MyDeveloperDay wrote:
> >
zequanwu updated this revision to Diff 414149.
zequanwu marked an inline comment as done.
zequanwu added a comment.
Add a test for `namespace A B {`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121269/new/
https://reviews.llvm.org/D121269
Files:
curdeius added inline comments.
Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:192-211
+ EXPECT_EQ("#define M(x) x##x\n"
+"namespace A M(x) {\n"
+"int i;\n"
+"int j;\n"
+"}// namespace A M(x)",
+fi
thakis resigned from this revision.
thakis added a comment.
(deferring to MyDeveloperDay and curdeius)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121269/new/
https://reviews.llvm.org/D121269
___
cfe-c
12 matches
Mail list logo