title: Is this const_cast undefined behavior?
body: <p>I was wondering whether the following is undefined behavior</p>
  
  <pre><code>// Case 1:
  int *p = 0;
  int const *q = *const_cast&lt;int const* const*&gt;(&amp;p);
  
  // Case 2: (I think this is the same)
  int *p = 0;
  int const *const *pp = &amp;p;
  int const *q = *pp;
  </code></pre>
  
  <p>Is this undefined behavior by reading a <code>int*</code> as if it were a <code>int const*</code>? I think it is undefined behavior, but I previously thought that only adding <code>const</code> in general is safe, so I'm unsure. </p>