CJ-Johnson added a comment.

In D113148#3108993 <https://reviews.llvm.org/D113148#3108993>, @aaron.ballman 
wrote:

> Generally speaking, we prefer to improve the existing checks. I think 
> `bugprone-string-constructor` would probably be a better place for the 
> constructor-related functionality. But that still means we don't have a good 
> place for things like the assignment and comparison functionality, and it 
> seems more useful to keep all of the `string_view`-with-`nullptr` logic in 
> one place. That said, we should be careful we're not too onerous when users 
> enable all `bugprone` checks together.

I agree with the statement "it seems more useful to keep all of the 
`string_view`-with-`nullptr` logic in one place". To me, these are very 
logically related. The fact that some of it is constructor based is not as 
useful from a user perspective. The relationship between `nullptr` and 
`string_view` is more important, in my view.

As for "we should be careful we're not too onerous when users enable all 
`bugprone` checks together.", these fixes are about preventing UB. While I did 
put this in the "bugprone" module, perhaps "prone" is the wrong way to think 
about it. It's unconditionally UB in all cases, not just a potential bug. The 
suggested fixes are important for preventing crashes in the short term, but 
more importantly for allowing the code to build in the future, since the 
constructor overload `basic_string_view(nullptr_t) = delete;` is being added.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113148

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to