Suppose that I have the following (trimmed down) code:
class P { P(); P(const P&); ~P(); }
void foo(P x) {
...
}
The caller destroys it. See https://en.cppreference.com/w/cpp/language/lifetime. Quoting:
All temporary objects are destroyed as the last step in evaluating the full-expression that (lexically) contains the point where they were created, and if multiple temporary objects were created, they are destroyed in the order opposite to the order of creation.
Also keep this as general rule - one, who creates, destroys. Usually in reversed order.