higher-performance wrote:

@AaronBallman: Oh I see. I didn't have any plans to upstream any matchers that 
used this, though I suppose I could. The check I had in mind though ostensibly 
could be in-tree, if you guys were interested. Though now that I think about it 
more, I think it would need `isTriviallyDestructible` rather than 
`isTrivially`. It basically detects whether there is an assignment of the form
```
<trivialy_destructible_type> = <destructible_type>;
```
which is frequently (but not always) dubious.
The canonical example here would be:
```
std::string Get();
std::string_view sv;
sv = Get();  // dangling pointer
```
which results in a dangling pointer. `-Wdangling` would catch the obvious 
candidates annotated with `lifetimebound`, but this check would surface things 
that might not be annotated.

https://github.com/llvm/llvm-project/pull/90634
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to