https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60372

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1880

Section: 7.6.1.3  [expr.call]     Status: CD4     Submitter: Hubert Tong    
Date: 2014-02-25
[Adopted at the June, 2016 meeting as part of paper P0135R1.]

According to 7.6.1.3 [expr.call] paragraph 4,

The lifetime of a parameter ends when the function in which it is defined
returns. The initialization and destruction of each parameter occurs within the
context of the calling function.
This presumably means that the destruction of the parameter object occurs
before the end of the full-expression, unlike temporaries. This is not what
current implementations do, however. It is not clear that a change to treat
parameter objects like temporaries, to match existing practice, would be an
improvement, however, as it would result in ABI breakage for implementations
that destroy parameters in the called function.

See also issue 1935 for a related question regarding the handling of arguments
to a placement allocation function and placement deallocation function.

Notes from the June, 2014 meeting:

WG decided to make it ****unspecified**** whether parameter objects are
destroyed immediately following the call or ****at the end of the
full-expression to which the call belongs***. This approach also resolves issue
1935.

Reply via email to