Hi,
Here is a simple example:
#include <cstdint> class Foo final { public: uint8_t packed; public: inline Foo(void) : packed(0xFF) {} //causes error inline ~Foo(void) = default; }; static_assert(sizeof(Foo)==sizeof(uint8_t),"Implementation error!"); int main(int /*argc*/, char* /*argv*/[]) { Foo* arr = new Foo[4]; //Tried a bunch of different sizes. All fail. delete [] arr; return 0; }
This program is valid C++, yet erroneously corrupts its own memory when run, and crashes. The constructor line appears to be the culprit. The program was compiled with Intel C++ 16.0.
For your convenience, here is a link to a complete solution that demonstrates the problem. Here is a link to the assembled code.
-i