Home | History | Annotate | Download | only in Helpers
      1 int zero_init() { return 0; }
      2 int badGlobal = zero_init();
      3 int readBadGlobal() { return badGlobal; }
      4 
      5 namespace badNamespace {
      6 class BadClass {
      7  public:
      8   BadClass() { value = 0; }
      9   int value;
     10 };
     11 // Global object with non-trivial constructor.
     12 BadClass bad_object;
     13 }  // namespace badNamespace
     14 
     15 int accessBadObject() { return badNamespace::bad_object.value; }
     16