title: Placement new is writing more bytes than array size
body: <p>In the following program I expected 10 bytes to be overwritten with placement new and then for the destructor to be called for each byte:</p>
  
  <pre><code>#include &lt;memory&gt;
  
  struct MyChar {
      MyChar(char c = 'n') :c{c}{}
      ~MyChar(){ c = 'd'; }
      char c;
  };
  
  int main()
  {
      {
          MyChar first[10]{0,1,2,3,4,5,6,7,8,9};
          new (first)MyChar[10]{10,11,12,13,14,15,16,17,18,19};
      }
      return 0;
  }
  </code></pre>
  
  <p>But the compiler (*) warns that 18 will be written:</p>
  
  <blockquote>
    <p>warning C6386: Buffer overrun while writing to 'first':  the writable
    size is '10' bytes, but '18' bytes might be written.</p>
  </blockquote>
  
  <p>At first the bytes are written as expected:
  <a href="https://i.stack.imgur.com/TSR09.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TSR09.png" alt="enter image description here"></a></p>
  
  <p>But the compiler wasn't bluffing. At the placement new statement it does write 18 bytes:
  <a href="https://i.stack.imgur.com/iSy9Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iSy9Y.png" alt="enter image description here"></a></p>
  
  <p>Which results in an error:</p>
  
  <blockquote>
    <p>Run-Time Check Failure #2 - Stack around the variable 'first' was
    corrupted.</p>
  </blockquote>
  
  <p>Why doesn't it stick to 10 bytes? <code>sizeof(MyChar)==1</code> and <code>alignof(MyChar)==1</code>.</p>
  
  <hr>
  
  <p>(*) Microsoft Visual Studio Community 2017 Preview (2). Also (but without warning during compilation) I get the same memory overwritten and runtime error on Microsoft Visual Studio Community 2017 (Version 15.2 (26430.15) Release).</p>