<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hello UB-Experts,</div>
<div> </div>
<div>as far as I can see the following (static_cast) is UB:</div>
<div> </div>
<div>struct B {</div>
<div> int i;</div>
<div>};</div>
<div> </div>
<div>struct D : B {</div>
<div> void foo() { /* access B::i */ }</div>
<div>};</div>
<div> </div>
<div>B b;</div>
<div>static_cast<D&>(b).foo();</div>
<div> </div>
<div>because of [expr.static.cast] clause 11</div>
<div> </div>
<div>first question: is my assessment of the situation correct or is this use legal?</div>
<div>if it is not (legal): could we make it legal or would we run afoul of the aliasing rules?</div>
<div> </div>
<div>best regards</div>
<div> </div>
<div>Fabio</div>
</div></div></body></html>