- Re-use approach used in codegen. MaterializeTemporaryExpr may be positioned in a strange manner, above the member access to the temporary, which makes it a bit tricky to find the expression that actually corresponds to the temporary object. FIXME: Hmm, probably we should re-use this approach in CFG as well (cf. D22419).
- Create the temporary region that corresponds to the full temporary object, rather than to the sub-object. This was a bug.
- If lifetime extension occurs, use the temporary object region's path-sensitive type, rather than reference variable type, in order to call the correct destructor.
dcoughlin a.sidorin zaks.anna xazax.hun
- rG28ee2d1b0973: [analyzer] Construct temporary objects of correct types, destroy them properly.
rC288263: [analyzer] Construct temporary objects of correct types, destroy them properly.
rL288263: [analyzer] Construct temporary objects of correct types, destroy them properly.
|11 ↗||(On Diff #78476)|
I copy-pasted this from the original bug report. The only purpose of S is to provide a non-trivial destructor. I also thought it'd be a nice twist to the test to make the destructor non-obvious, but it doesn't really matter. Removed.