[PATCH] D149259: [analyzer][NFC] Use std::optional instead of custom "empty" state

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 26 08:04:41 PDT 2023


steakhal accepted this revision.
steakhal added a comment.
This revision is now accepted and ready to land.

Approved, assuming we prefer `std::nullopt` over the default construction of `std::optional` and you `clang-format` the affected hunks, such as the declaration of `computeOffset`.
Make sure the commit message complies with:

- https://www.llvm.org/docs/Phabricator.html#committing-a-change
- https://llvm.org/docs/DeveloperPolicy.html#commit-messages



================
Comment at: clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp:324
         }
-        return RegionRawOffsetV2();
+        return {};
       }
----------------
I'd recommend using the more explicit version for such cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149259



More information about the cfe-commits mailing list