The temporary will be destroyed at the end of the expression, namely the ;
semicolon. So you are safe.
§ 12.2 ... Temporary objects are destroyed as the last step in evaluating the full-expression (1.9) that (lexically) contains the point where they were created. This is true even if that evaluation ends in throwing an exception.