HazardyKnusperkeks added a comment.

In D119893#3325375 <https://reviews.llvm.org/D119893#3325375>, @curdeius wrote:

> +1 to Arthur's comments.
> Does it fix any of the recently created issues?

Yeah, I should have put that in the commit message, right? ;)

Maybe I would have discovered the bug myself, but this is from GitHub.



================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3018-3019
   do {
+    bool LambdaThisTimeAllowed = LambdaNextTimeAllowed;
+    LambdaNextTimeAllowed = false;
+
----------------
Quuxplusone wrote:
> Nit: For this pattern, consider `bool LambdaThisTimeAllowed = 
> std::exchange(LambdaNextTimeAllowed, false);`
I was under the impression that exchange was C++17. If I'd known that it's 14 
and I can use it, I'd done that in the first place.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3102
+      LambdaNextTimeAllowed = true;
+      LLVM_FALLTHROUGH;
+    case tok::numeric_constant:
----------------
Quuxplusone wrote:
> This seems like an overuse of fallthrough; how about simply
> ```
>     LambdaNextTimeAllowed = true;
>     nextToken();
>     break;
> ```
> ?
Can do. I'm just thinking if there is ever a change to what to do, not just 
`nextToken()`, I would have to change it only at 2 not 3 places. But probably 
that will never happen.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119893/new/

https://reviews.llvm.org/D119893

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D1198... Björn Schäpers via Phabricator via cfe-commits
    • [PATCH] ... Arthur O'Dwyer via Phabricator via cfe-commits
    • [PATCH] ... Marek Kurdej via Phabricator via cfe-commits
    • [PATCH] ... Björn Schäpers via Phabricator via cfe-commits
    • [PATCH] ... Marek Kurdej via Phabricator via cfe-commits
    • [PATCH] ... Björn Schäpers via Phabricator via cfe-commits
    • [PATCH] ... Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
    • [PATCH] ... Marek Kurdej via Phabricator via cfe-commits
    • [PATCH] ... Björn Schäpers via Phabricator via cfe-commits
    • [PATCH] ... Marek Kurdej via Phabricator via cfe-commits
    • [PATCH] ... Björn Schäpers via Phabricator via cfe-commits

Reply via email to