https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109470
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Johannes Kellner from comment #3) > 'A temporary object bound to a reference parameter in a function call > persists until the completion of the full-expression containing the call.' > > So this does not mean, that the temporary object, (int)lenght, should life > until the end of main ??? As main() is the enclosing scope? No, because it says "completion of the full-expression" not "end of the enclosing scope". The full-expression ends at the semi-colon.