https://issues.dlang.org/show_bug.cgi?id=13586

--- Comment #7 from Walter Bright <bugzi...@digitalmars.com> ---
(In reply to Andrei Alexandrescu from comment #5)
> (In reply to Walter Bright from comment #3)
> > (In reply to Sobirari Muhomori from comment #1)
> > > Shouldn't the argument be destructed by the caller when the callee 
> > > returns?
> > 
> > Yes. Once the function gets called, it gets marked by the compiler as "don't
> > destroy this".
> 
> Wait, I'm confused. On the normal path (no exceptions) isn't the callee
> destroying its by-value arguments?

Yes. If the function doesn't get called, then the caller has to call the
destructors on the partially constructed argument list. If the function does
get called, then the function destroys the arguments.

Hence having the compiler mark it to be careful where the destructor code gets
placed.

--

Reply via email to