/*
 * $ g++-8 -std=c++17 -o uninit uninit.cc && ./uninit
 * e=0x55ea8d07bc20 e->foo=0
 * e=0x55ea8d07bc20 e->foo=0
 *
 * $ g++-8 -fsanitize=address -std=c++17 -o uninit uninit.cc && ./uninit
 * e=0x602000000010 e->foo=bebebebe
 * e=0x602000000030 e->foo=bebebebe
 *
 * $ clang++-7 -fsanitize=memory -std=c++17 -o uninit uninit.cc && ./uninit
 * e=0x701000000000 e->foo=0
 * e=0x701000000000 e->foo=ffaaffaa
 *
 * $ clang++-7 -fsanitize=address -std=c++17 -o uninit uninit.cc && ./uninit
 * e=0x602000000010 e->foo=bebebebe
 * e=0x602000000030 e->foo=bebebebe
 *
 */
#include <iostream>

int main() {
  struct Ele {
    int foo;
  };
  auto* e = new Ele;
  std::cout << "e=" << e << std::hex << " e->foo=" << e->foo << '\n';
  e->foo = 0xffaaffaa;
  delete e;
  e = new Ele;
  std::cout << "e=" << e << std::hex << " e->foo=" << e->foo << '\n';
  delete e;
}
