title: Is casting a pointer to const pointer and cast back to the original type undefined?
body: <p>I know casting a const pointer to non-const type might be undefined behavior, but what if the pointer is originally not const?</p>
  
  <pre><code>int i = 0;
  int * pi = &amp;i;
  const int * const_pi = const_cast&lt;const int*&gt;(pi);
  int * non_const_pi = const_cast&lt;int*&gt;(const_pi);
  *non_const_pi = 0;
  *non_const_pi = 1;
  int j = *non_const_pi;
  </code></pre>
  
  <p>Is there's any undefined behavior? If any, where do they happen? May the compiler assume that <code>non_const_pi</code> is casted from a const pointer and perform no modification?</p>