title: Is sizeof(*ptr) undefined behavior when pointing to invalid memory?
body: <p>We all know that dereferencing an null pointer or a pointer to unallocated memory invokes undefined behaviour.</p>
  
  <p>But what is the rule when used within an expression passed to <code>sizeof</code>?</p>
  
  <p>For example:</p>
  
  <pre><code>int *ptr = 0;
  int size = sizeof(*ptr);
  </code></pre>
  
  <p>Is this also undefined?</p>