title: Does 'a[i] = i;' always result in well defined behaviour?
body: <p>There are several interesting questions raised <a href="https://stackoverflow.com/q/9056072/113124">here</a> regarding undefined behaviour in C. One of them is (slightly modified)</p>
  <blockquote>
  <p>Does the following piece of code result in undefined behaviour?</p>
  <pre><code>int i = 0, *a = &amp;i;   // Line 1
  a[i] = i + 1;         // Line 2
  </code></pre>
  </blockquote>
  <p>Since there is no concrete answer to this part of the question there, and I am interested in knowing the behaviour in C++, I am raising it again here.</p>
  <hr />
  <p>Rule #2 from <a href="https://stackoverflow.com/a/4176333/113124">Undefined Behavior and Sequence Points</a> says</p>
  <blockquote>
  <p>Furthermore, the prior value shall be accessed only to determine the value to be stored</p>
  </blockquote>
  <p>Clearly in the example above, the value is being accessed twice: <code>a[i]</code> (lhs) and <code>i</code> (rhs), and only one of them (the rhs) determines the value to be stored.</p>
  <p><strong>Does Line 2 violate the rule above and result in undefined behaviour in C++03?</strong></p>
  <hr />
  <p>There is some confusion as to whether <code>i</code> is modified at Line 2?</p>
  <p><a href="http://ideone.com/VZJ4N" rel="noreferrer"><strong>Yes it is modified!</strong></a></p>