Only register temporaries for which lifetime extension is actually required.