On 07/23/2015 10:20 PM, Steven Schveighoffer wrote:
On 7/23/15 2:43 PM, anonymous wrote:
Steven disagrees and thinks that there are cases where it's ok. Namely,
this simple case would be ok:

----
int x;
const int *y = &x;
*(cast(int *)y) = 5;
----

Yes, IMO, this should simply work and be consistent. The compiler could
use willful ignorance to assume x is still 0, but I find that to be
counterproductive. It would have to implement flow analysis to determine
that y must point at x, and then simply ignore the assignment during
that analysis.
...

No, it would be sufficient to have a simple form of constant propagation to screw up here.

Reply via email to