Full name of submitter: Andrey Erokhin
Reference (section label): [basic.life]
Link to reflector thread (if any):
Issue description:
[basic.life]/1:
The lifetime of an object of type T begins when:
— storage with the proper alignment and size for type T is obtained
What about improper alignment and size? For alignment, there is [basic.align]/1:
Attempting to create an object ([intro.object]) in storage that does not meet the alignment requirements of the object's type is undefined behavior ([ub:basic.align.object.alignment]).
However, I couldn't find UB for size, meaning that in
alignas(int) unsigned char c;
auto pi = ::new(&c) int(0); // creates an int object whose lifetime just doesn't start?
Suggested resolution:
Full name of submitter: Andrey Erokhin
Reference (section label): [basic.life]
Link to reflector thread (if any):
Issue description:
[basic.life]/1:
What about improper alignment and size? For alignment, there is [basic.align]/1:
However, I couldn't find UB for size, meaning that in
Suggested resolution: