[Issue 18756] Escaping address of temporary struct field

2020-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18756

Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution|--- |INVALID

--- Comment #6 from Walter Bright  ---
The compiler is working as designed.

--


[Issue 18756] Escaping address of temporary struct field

2019-08-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18756

Nick Treleaven  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=20183

--


[Issue 18756] Escaping address of temporary struct field

2019-08-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18756

Nick Treleaven  changed:

   What|Removed |Added

   Keywords||accepts-invalid

--- Comment #5 from Nick Treleaven  ---
Still present with DMD32 D Compiler v2.088.0-rc.1

--


[Issue 18756] Escaping address of temporary struct field

2018-04-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18756

--- Comment #4 from Jonathan M Davis  ---
(In reply to anonymous4 from comment #3)
> (In reply to Jonathan M Davis from comment #2)
> > because it's always a bug.
> It's correct when the result is passed to a function parameter.

How so?

--


[Issue 18756] Escaping address of temporary struct field

2018-04-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18756

anonymous4  changed:

   What|Removed |Added

   Hardware|x86 |All
 OS|Windows |All

--- Comment #3 from anonymous4  ---
(In reply to Jonathan M Davis from comment #2)
> because it's always a bug.
It's correct when the result is passed to a function parameter.

--


[Issue 18756] Escaping address of temporary struct field

2018-04-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18756

Jonathan M Davis  changed:

   What|Removed |Added

 CC||issues.dl...@jmdavisprog.co
   ||m

--- Comment #2 from Jonathan M Davis  ---
Without -dip1000, & is not @safe. So, it's bug in that sense regardless. But on
top of that, it's taking the address of a _temporary_. It's never @safe to take
the address of a temporary and ideally, it wouldn't even be allowed in @sytem
code, because it's always a bug.

--


[Issue 18756] Escaping address of temporary struct field

2018-04-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18756

greenify  changed:

   What|Removed |Added

 CC||greeen...@gmail.com

--- Comment #1 from greenify  ---
Taking an address is allowed in dip1000 and also @safe 

I don't see any violation of safety in your example. The thing that isn't
allowed is storing the address or returning it (though that is sometimes
allowed when the compiler can guarantee that it will be @safe).

So AFAICT this is invalid?

--


[Issue 18756] Escaping address of temporary struct field

2018-04-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18756

Radu Racariu  changed:

   What|Removed |Added

   Keywords||safe
 CC||radu.raca...@gmail.com

--