[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-17 Thread MyDeveloperDay via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG873308fd8c96: [Format] Fix incorrect pointer/reference detection (authored by Nuu, committed by MyDeveloperDay). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-17 Thread Yilong Guo via Phabricator via cfe-commits
Nuu added a comment. In D103678#2811302 , @HazardyKnusperkeks wrote: > Do you need some one to commit this? If yes please state name and email, some > one will chime in to commit it. Yes, please someone help commit this. Name: Yilong Guo Email: yi

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-10 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks accepted this revision. HazardyKnusperkeks added a comment. Do you need some one to commit this? If yes please state name and email, some one will chime in to commit it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103678/new/ https://reviews.llvm.org/D103678 _

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-08 Thread Yilong Guo via Phabricator via cfe-commits
Nuu added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:236 +Prev = Prev->Previous; +assert(Prev); + } MyDeveloperDay wrote: > curdeius wrote: > > MyDeveloperDay wrote: > > > Do we need to worry about `Prev` ever being

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-08 Thread Yilong Guo via Phabricator via cfe-commits
Nuu updated this revision to Diff 350756. Nuu added a comment. Minor updates. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103678/new/ https://reviews.llvm.org/D103678 Files: clang/lib/Format/TokenAnnotator.cpp clang/unittests/Format/FormatTest.cpp Index: clang/unittests

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-08 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:8283-8286 + // TODO: + // Calling an operator as a non-member function is hard to distinguish + // verifyFormat("void f() { operator*(a & a); }"); + // verifyFormat("void f() { operator&(a

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-08 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:236 +Prev = Prev->Previous; +assert(Prev); + } curdeius wrote: > MyDeveloperDay wrote: > > Do we need to worry about `Prev` ever being null? Does the assert

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-08 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM modulo nits. Comment at: clang/lib/Format/TokenAnnotator.cpp:232 if (Left->is(TT_OverloadedOperatorLParen)) { - Contexts.back().IsExpression = false; + // Find the previous kw_operator token + F

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-08 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision. MyDeveloperDay added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:236 +Prev = Prev->Previous; +assert(Prev); + } Do we need to worry about `Prev` ever being null? Does the assert ever

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-08 Thread Yilong Guo via Phabricator via cfe-commits
Nuu added a comment. Pre-check failure: the github server is currently down. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103678/new/ https://reviews.llvm.org/D103678 ___ cfe-commits mailing list cf

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-08 Thread Yilong Guo via Phabricator via cfe-commits
Nuu marked an inline comment as done. Nuu added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:243 + bool OperatorCalledAsMemberFunction = + Prev->Previous && Prev->Previous->isOneOf(tok::period, tok::arrow); + Contexts.back().IsExpres

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-08 Thread Yilong Guo via Phabricator via cfe-commits
Nuu updated this revision to Diff 350519. Nuu added a comment. Add more tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103678/new/ https://reviews.llvm.org/D103678 Files: clang/lib/Format/TokenAnnotator.cpp clang/unittests/Format

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-04 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:243 + bool OperatorCalledAsMemberFunction = + Prev->Previous && Prev->Previous->isOneOf(tok::period, tok::arrow); + Contexts.back().IsExpression = OperatorCalledAsMemberFuncti

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-04 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:8768 + verifyFormat("void f() { a.operator()(a * a); }"); + verifyFormat("void f() { a->operator()(a & a); }"); } can you add void f() { a.operator()(*a * *a); } Reposit

[PATCH] D103678: [Format] Fix incorrect pointer/reference detection

2021-06-04 Thread Yilong Guo via Phabricator via cfe-commits
Nuu created this revision. Nuu added reviewers: djasper, HazardyKnusperkeks, curdeius, MyDeveloperDay. Nuu added a project: clang-format. Nuu requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. https://llvm.org/PR50568 When an