[PATCH] D147357: [clang-tidy] Add bugprone-optional-value-conversion check

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 20 14:03:13 PDT 2023


PiotrZSL marked 2 inline comments as done.
PiotrZSL added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/optional-value-conversion.cpp:16
+  };
+}
+
----------------
njames93 wrote:
> PiotrZSL wrote:
> > njames93 wrote:
> > > It'd be good to have tests demonstating `boost::optional` and `absl::optional` as well as the (non standard) get accessor
> > I added them to config just to add them, as they should work, I could add some tests for them, but behavior should be same...
> On the subject of boost(unsure about absl as I've never used that library)
> Would you ever add support for `T& boost::get(boost::optional<T> &)` or its const ref cousin?
No, I'm not planing to add support for boost::get. I added basic support for boost and absl only because it's cheap, and interfaces are similar. Main target is std::optional. And configuration is provider just because for example in project that I work for we got custom optional implementation. 
Added info about limited support for non-standard optional.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147357



More information about the cfe-commits mailing list