<div dir="ltr">On 8 January 2013 18:40, Matthieu Monrocq <span dir="ltr"><<a href="mailto:matthieu.monrocq@gmail.com" target="_blank">matthieu.monrocq@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I do believe it's undefined.<br><div class="gmail_quote"><div><br>§5.2.1 Subscripting [expr.sub]<br>...<br>§5.7 Additive operators [expr.add]<br>
...<br></div></div></blockquote><div><br></div><div style>Still, doesn't explicitly say it's undefined. I agree this gives the freedom of implementers to extend naturally, but it's at least arguable. I have the 2011 draft and couldn't find anything, nor in the current open issues.</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>Obviously, a warning, if possible, could be nice; but in general I am afraid this is more the domain of static analysis as it requires "guessing" the bounds of the loop. It might have been caught with ubsan though (I think there is an out-of-bounds checker).<br>
</div></div></blockquote><div><br></div><div style>Is the static analyser in clang-extra-tools?</div><div style><br></div><div style>cheers,</div><div style>--renato</div></div></div></div>