title: Pointer to element of object representation or pointer to an element of the provided storage?
body: <p>Let's suppose I have the following code:</p>
  
  <pre><code>int* p = new (new unsigned char[3*sizeof(int)]) int{};
  unsigned char* b = reinterpret_cast&lt;unsigned char*&gt;(p);
  auto b2 = b + 2*sizeof(int);//it is UB if compilers do not assume that
                              //b is pointer to an unsigned char[3*sizeof(int)]
  int* p2 = new (b2) int{}; 
  </code></pre>
  
  <p>If <code>b</code> is not a pointer to the array of <code>3*sizeof(int)</code> unsigned char that provides storage for <code>*p</code>, then the section [expr.add] of the C++ standard implies that <code>b+2*sizeof(int)</code> is undefined behavior (UB). Otherwise if the compiler must assume that <code>b</code> is also a pointer to the array of unsigned char that provides storage for <code>*p</code> then it is not UB.</p>
  
  <p>So is it specified in the standard that compilers must assume that <code>b</code> is a pointer to the <code>unsigned char[3*sizeof(int)]</code>that provides storage for <code>*p</code>?</p>