melver added a comment.
In https://reviews.llvm.org/D51036#1223254, @sammccall wrote:
> In https://reviews.llvm.org/D51036#1223230, @melver wrote:
>
> > Awaiting remaining reviewer acceptance.
> >
> > FYI: I do not have commit commit access -- what is the procedure to commit
> > once diff is acc
This revision was automatically updated to reflect the committed changes.
Closed by commit rL341450: clang-format: Fix formatting C++ namespaces with
preceding 'inline' or 'export'… (authored by sammccall,
committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
https://re
owenpan accepted this revision.
owenpan added a comment.
This revision is now accepted and ready to land.
In https://reviews.llvm.org/D51036#1223254, @sammccall wrote:
> In https://reviews.llvm.org/D51036#1223230, @melver wrote:
>
> > Awaiting remaining reviewer acceptance.
> >
> > FYI: I do not
sammccall added a comment.
In https://reviews.llvm.org/D51036#1223230, @melver wrote:
> Awaiting remaining reviewer acceptance.
>
> FYI: I do not have commit commit access -- what is the procedure to commit
> once diff is accepted?
>
> Many thanks!
Anyone with commit access can land it for you
melver added a comment.
Awaiting remaining reviewer acceptance.
FYI: I do not have commit commit access -- what is the procedure to commit once
diff is accepted?
Many thanks!
Repository:
rC Clang
https://reviews.llvm.org/D51036
___
cfe-commits
melver added inline comments.
Comment at: lib/Format/Format.cpp:1312
auto &Line = *AnnotatedLines[i];
if (Line.startsWith(tok::kw_namespace) ||
+ Line.startsWith(tok::kw_inline, tok::kw_namespace) ||
owenpan wrote:
> sammccall wrote:
> > th
melver updated this revision to Diff 162653.
melver marked 4 inline comments as done.
melver added a comment.
Many thanks! PTAL.
Repository:
rC Clang
https://reviews.llvm.org/D51036
Files:
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/NamespaceEndCommentsFixer.cpp
lib/For
owenpan added inline comments.
Comment at: lib/Format/UnwrappedLineFormatter.cpp:533-535
+ !(Line.startsWith(tok::kw_namespace) ||
+ Line.startsWith(tok::kw_inline, tok::kw_namespace) ||
+ Line.startsWith(tok::kw_export, tok::kw
owenpan added inline comments.
Comment at: lib/Format/Format.cpp:1312
auto &Line = *AnnotatedLines[i];
if (Line.startsWith(tok::kw_namespace) ||
+ Line.startsWith(tok::kw_inline, tok::kw_namespace) ||
sammccall wrote:
> these 3 startswith c
sammccall added inline comments.
Comment at: unittests/Format/FormatTest.cpp:7582
Style);
+ verifyFormat("export namespace Foo\n"
+ "{};",
you may want to add tests for other modules TS syntax (e.g. non-namespace
export decls).
It
sammccall accepted this revision.
sammccall added a comment.
Nice fix!
Comment at: lib/Format/Format.cpp:1312
auto &Line = *AnnotatedLines[i];
if (Line.startsWith(tok::kw_namespace) ||
+ Line.startsWith(tok::kw_inline, tok::kw_namespace) ||
--
melver updated this revision to Diff 161960.
melver marked 8 inline comments as done.
melver added a comment.
Many thanks for the suggestions!
PTAL.
Repository:
rC Clang
https://reviews.llvm.org/D51036
Files:
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/NamespaceEndCommen
owenpan added inline comments.
Comment at: lib/Format/UnwrappedLineParser.cpp:1066-1072
+if (Style.isCpp()) {
+ nextToken();
+ if (FormatTok->Tok.is(tok::kw_namespace)) {
+parseNamespace();
+return;
+ }
+}
owenpan wrote:
> `
owenpan added inline comments.
Comment at: lib/Format/NamespaceEndCommentsFixer.cpp:128-133
+ // Detect "(inline|export)? namespace" in the beginning of a line.
+ if (NamespaceTok->is(tok::kw_inline) || NamespaceTok->is(tok::kw_export))
NamespaceTok = NamespaceTok->getNext
owenpan added inline comments.
Comment at: lib/Format/NamespaceEndCommentsFixer.cpp:129-130
+ // Detect "(inline|export)? namespace" in the beginning of a line.
+ if (NamespaceTok->is(tok::kw_inline) || NamespaceTok->is(tok::kw_export))
NamespaceTok = NamespaceTok->getNext
owenpan requested changes to this revision.
owenpan added a comment.
This revision now requires changes to proceed.
By the way, I didn't review the test cases.
Comment at: lib/Format/FormatToken.h:524-525
+// Detect "(inline|export)? namespace" in the beginning of a line.
+
melver created this revision.
Herald added a subscriber: cfe-commits.
This fixes formatting namespaces with preceding 'inline' and 'export' (Modules
TS) specifiers.
This change fixes namespaces not being identified as such with preceding
'inline' or 'export' specifiers.
Motivation: I was exper
17 matches
Mail list logo