title: Is a pointer with the right address and type still always a valid pointer since C++17?
body: <p><sub>(In reference to <a href="https://stackoverflow.com/questions/48058545/are-there-any-guarantees-for-unions-that-contain-a-wrapped-type-and-the-type-its/48060029#48060029">this question and answer</a>.)</sub></p>
  
  <p>Before the C++17 standard, the following sentence was included in <a href="https://timsong-cpp.github.io/cppwp/n4140/basic.compound#3" rel="noreferrer">[basic.compound]/3</a>:</p>
  
  <blockquote>
    <p>If an object of type T is located at an address A, a pointer of type cv T* whose value is the address A is said to point to that object, regardless of how the value was obtained.</p>
  </blockquote>
  
  <p>But since C++17, this sentence has been <a href="https://timsong-cpp.github.io/cppwp/n4659/basic.compound#3" rel="noreferrer">removed</a>.</p>
  
  <p>For example I believe that this sentence made this example code defined, and that since C++17 this is undefined behavior:</p>
  
  <pre><code> alignas(int) unsigned char buffer[2*sizeof(int)];
   auto p1=new(buffer) int{};
   auto p2=new(p1+1) int{};
   *(p1+1)=10;
  </code></pre>
  
  <p>Before C++17, <code>p1+1</code> holds the address to <code>*p2</code> and has the right type, so <code>*(p1+1)</code> is a pointer to <code>*p2</code>. In C++17 <code>p1+1</code> is a <a href="https://timsong-cpp.github.io/cppwp/n4659/basic.compound#3.2" rel="noreferrer"><em>pointer past-the-end</em></a>, so it is not a <em>pointer to object</em> and I believe it is not dereferencable.</p>
  
  <p>Is this interpretation of this modification of the standard right or are there other rules that compensate the deletion of the cited sentence?</p>