[PATCH] D151192: [clang-tidy] have bugprone-unchecked-optional-access check boost::optional usage

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 04:22:57 PDT 2023


gribozavr2 added a comment.

The mock optional types in the unit test are just declarations of the API - they don't need any implementations (function or method bodies should be omitted). But the declarations of classes, methods, and functions should mirror the production header closely. There are many seemingly trivial choices one can make when designing an API for a complex type like optional - for example, the specific choice of constructor overload set members, choosing to implement an overload set as a set of concrete functions vs. one function template, SFINAE on any functions, additional defaulted template parameters that the user isn't supposed to set etc. These differences would be hardly noticeable for the majority of "boring" C++ code that uses an optional, but they can be detrimental to tooling's ability to identify calls to the relevant APIs.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151192



More information about the cfe-commits mailing list