Fix compilation with clang, fix few memory issues, improve test robustness
Complication with clang currently fails as pipeline 312033513 showed. That is the case since the Placement class has been dissolved into the win namespace in the form of function templates.
The clang compiler does not like a construction like
!flags(..) with the flags ctor for enum class bitfields. It is kind of weird that GCC does not have a problem with it ever and clang had no problem with it likewise when the code was in the placement.cpp source file. Maybe that's a bug in clang.
Anyways, just removing the flags ctor and negating the enum class directly fixes the compilation with clang again.
The other commits in this branch are various little fixes to memory handling and tests.