196. Placement new example has alignment problems

Section: 21.6.2.3 [new.delete.placement] Status: Dup Submitter: Herb Sutter Opened: 1998-12-15 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [new.delete.placement].

View all issues with Dup status.

Duplicate of: 114

Discussion:

The example in 21.6.2.3 [new.delete.placement] paragraph 4 reads:

[Example: This can be useful for constructing an object at a known address:

   char place[sizeof(Something)];
   Something* p = new (place) Something();

end example]

This example has potential alignment problems.

Rationale: