[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)
Alexander Kornienko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 17 10:43:30 PST 2021
alexfh added a comment.
In D113148#3127646 <https://reviews.llvm.org/D113148#3127646>, @ymandel wrote:
> This looks really good. An impressive effort! Just a few changes. Also, please ping Alex to get his opinion on the high level issue.
Since this check focuses really well on the issue of creating `string_view` from `nullptr` (and unlike the other check in this case, provides automated fixes), it seems best to limit the warning for `nullptr` argument in bugprone-string-constructor to `std::string`.
As for creating a "certainly bugs" / "unconditional UB" module: how many checks apart from this one would fall into that category? From a very brief look I found bugprone-dangling-handle and bugprone-undelegated-constructor. The latter could likely be reimplemented as a clang diagnostic. A separate module for two or three checks doesn't sound particularly exciting.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113148/new/
https://reviews.llvm.org/D113148
More information about the cfe-commits
mailing list