* gcc.dg/stack-check-5.c: Skip with -fstack-protector.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / delete3.C
blob9c6c58e966e265547ae0190a1acb9ad945b4805c
1 // { dg-do run  }
2 #include <new>
4 int i;
6 extern "C" int printf (const char *, ...);
8 template <class T, class U> 
9 struct map {
10   ~map ();
13 template <class T, class U>
14 map<T, U>::~map ()
17 struct SomeClass { };
19 void* operator new(std::size_t numBytes, SomeClass&, const std::nothrow_t&) throw()
21   return operator new(numBytes, std::nothrow);
24 void operator delete(void* pMemory, SomeClass&, const std::nothrow_t&) throw()
26   i = 7;
27   return operator delete(pMemory);
30 int
31 main()
33   map< int, int>* pMap = new map< int, int>;
34   
35   delete pMap;
36   
37   if (i == 7)
38     return 1;