"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. This is true even if that evaluation ends in throwing an exception."
https://en.cppreference.com/w/cpp/language/lifetime