usx95 wrote: I considered this during implementation. This is a little controversial.
It is possible that the temporary capturing object uses the captured entity in its destructor. In principle, we can always detect the order of destructions of the temporaries and choose to suppress cases when captured temporary outlives capturing temporary. But it would be a very confusing behaviour for the user, eg: switching order of params suppresses the warning. I would be in favour of not doing this and always diagnosing this for simplicity until we see a strong need or practical false positives. WDYT ? https://github.com/llvm/llvm-project/pull/117733 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits