[llvm] Stop abusing Twine in DiagnosticInfo (PR #136371)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 09:46:14 PDT 2025


bogner wrote:

> > > Can we just get a warning on the bad usage instead?
> > 
> > 
> > I'd be perfectly happy for this to just warn on misuse, but I don't think it's possible. Essentially we'd need to be able to warn on creating any of these `DiagnosticInfo*` classes on the stack, as the problematic pattern is as follows:
> 
> Seems to work if we add `[[clang::lifetimebound]]` to all of these constructor parameters

This looks promising, I’ll look into doing that instead.

https://github.com/llvm/llvm-project/pull/136371


More information about the llvm-commits mailing list