Bug 6497 – [safeD] Can take address of local variable through ?:
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-08-14T13:16:00Z
Last change time
2012-07-14T20:43:29Z
Keywords
accepts-invalid, pull
Assigned to
yebblies
Creator
timon.gehr
Comments
Comment #0 by timon.gehr — 2011-08-14T13:16:28Z
int* foo()@safe{
int n;
int*x=&(0?n:n);
return x;
}
This currently compiles without error.
(When fixing, make sure that safe functions can still assign to a ConditionalExpression, afaik it is currently implemented by taking the address of the 2. and 3. operands.)