Date
2022-01-06.00:00:00
Message id
2053

Content

According to _N4885_.20.10.5 [util.dynamic.safety] paragraph 16, when std::get_pointer_safety() returns std::pointer_safety::relaxed,

pointers that are not safely derived will be treated the same as pointers that are safely derived for the duration of the program.

However, _N4885_6.7.5.5.4 [basic.stc.dynamic.safety] paragraph 4 says unconditionally that

If a pointer value that is not a safely-derived pointer value is dereferenced or deallocated, and the referenced complete object is of dynamic storage duration and has not previously been declared reachable (_N4885_.20.10.5 [util.dynamic.safety]), the behavior is undefined.

This is a contradiction: the library clause attempts to constrain undefined behavior, which by definition is unconstrained.