"template with auto ref" experiment

Alex via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Feb 4 16:53:20 PST 2017


On Saturday, 4 February 2017 at 16:18:00 UTC, kinke wrote:
>
> It most likely only works because the dangling pointer points 
> into yet untouched stack. Trying to öet a normal by-value 
> parameter or local variable escape this way should produce an 
> error, but apparently it's not done for `auto ref` parameters 
> (the compiler should though, but only in the 
> by-value-template-instantiation).
> So this isn't cool at all ;) - please consider filing a 
> bugreport about this.

Ok, fine.
So the bug is that there is no error message about trying to get 
a pointer of an rvalue...


More information about the Digitalmars-d-learn mailing list