This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4986f3f2f220: [clang-format] Correctly annotate operator
free function call (authored by rymiel).
Repository:
rG LLVM Github Monorepo
CHANGES SIN
rymiel updated this revision to Diff 535859.
rymiel added a comment.
Address comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153798/new/
https://reviews.llvm.org/D153798
Files:
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/
owenpan accepted this revision.
owenpan added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:319
+ Prev->Previous->isOneOf(tok::period, tok::arrow)) ||
+ (!Line.MustBeDeclaration && !Line.InMacroBody);
Contexts.back().IsExpression = Ope
rymiel added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:319
+ Prev->Previous->isOneOf(tok::period, tok::arrow)) ||
+ (!Line.MustBeDeclaration && !Line.InMacroBody);
Contexts.back().IsExpression = OperatorCalledAsMemberFunction;
owenpan added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:319
+ Prev->Previous->isOneOf(tok::period, tok::arrow)) ||
+ (!Line.MustBeDeclaration && !Line.InMacroBody);
Contexts.back().IsExpression = OperatorCalledAsMemberFunction;
---
HazardyKnusperkeks accepted this revision.
HazardyKnusperkeks added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:316
+ // line can't be a declaration.
bool OperatorCalledAsMemberFunction =
+ (Prev->Previous &&
Nuu wrot
Nuu accepted this revision.
Nuu added a comment.
This revision is now accepted and ready to land.
Thanks, LGTM!
Comment at: clang/lib/Format/TokenAnnotator.cpp:316
+ // line can't be a declaration.
bool OperatorCalledAsMemberFunction =
+ (Prev->Prev
rymiel created this revision.
rymiel added reviewers: HazardyKnusperkeks, owenpan, MyDeveloperDay.
Herald added projects: All, clang, clang-format.
Herald added a subscriber: cfe-commits.
rymiel requested review of this revision.
The annotator correctly annotates an overloaded operator call when
c