[PATCH] D119893: [clang-format] Fixed handling of requires clauses followed by attributes

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 15 14:48:30 PST 2022


Quuxplusone added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3018-3019
   do {
+    bool LambdaThisTimeAllowed = LambdaNextTimeAllowed;
+    LambdaNextTimeAllowed = false;
+
----------------
Nit: For this pattern, consider `bool LambdaThisTimeAllowed = std::exchange(LambdaNextTimeAllowed, false);`


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3102
+      LambdaNextTimeAllowed = true;
+      LLVM_FALLTHROUGH;
+    case tok::numeric_constant:
----------------
This seems like an overuse of fallthrough; how about simply
```
    LambdaNextTimeAllowed = true;
    nextToken();
    break;
```
?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119893



More information about the cfe-commits mailing list