Home | History | Annotate | Download | only in jni
      1 // { dg-do run  }
      2 // Test for calling placement delete.
      3 
      4 #include <new>
      5 #include <stddef.h>
      6 
      7 int r = 1;
      8 
      9 struct A {
     10   A() { throw 1; }
     11   void operator delete (void *p, int, int) { r = 0; ::operator delete (p); }
     12 };
     13 
     14 void * operator new (size_t size, int, int) { return operator new (size); }
     15 
     16 int main ()
     17 {
     18   try {
     19     A* ap = new (1, 5) A;
     20   } catch (...) {  }
     21 
     22   return r;
     23 }
     24