This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6482383e50a4: [clang-format] FixNamespaceComments does not
understand namespace aliases (authored by MyDeveloperDay).
Repository:
rG LLVM Github
MyDeveloperDay updated this revision to Diff 394163.
MyDeveloperDay added a comment.
use endsWith()
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115647/new/
https://reviews.llvm.org/D115647
Files:
clang/lib/Format/NamespaceEndCommentsFixer.cpp
owenpan added inline comments.
Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:185-189
+ const FormatToken *Previous = AnnotatedLines[StartLineIndex - 1]->Last;
+ while (Previous && Previous->is(tok::comment)) {
+Previous = Previous->Previous;
+
curdeius accepted this revision.
curdeius added a comment.
This revision is now accepted and ready to land.
LGTM!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115647/new/
https://reviews.llvm.org/D115647
___
cfe-commits mailing list
MyDeveloperDay updated this revision to Diff 394010.
MyDeveloperDay added a comment.
Look backwards from the { rather than scanning the namespace
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115647/new/
https://reviews.llvm.org/D115647
Files:
HazardyKnusperkeks added inline comments.
Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:59
+ // Namespace alias
+ if (Tok->isOneOf(tok::equal, tok::semi))
+return false;
Should only be equal, right?
Otherwise please add a test for
curdeius added inline comments.
Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:27
// Returns "" for anonymous namespace.
-std::string computeName(const FormatToken *NamespaceTok) {
+bool computeName(const FormatToken *NamespaceTok, std::string ) {
MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: HazardyKnusperkeks, curdeius, owenpan.
MyDeveloperDay added projects: clang, clang-format.
Herald added a subscriber: jeroen.dobbelaere.
MyDeveloperDay requested review of this revision.