2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / p710.C
blob7fdd5b022381530631368d3445bffae3d5585d75
1 // { dg-do assemble  }
2 // GROUPS passed delete
3 /*
4   Bug Id: 
5   PRMS Id: p0000710
6   Bug is : overloading operator delete in class def not allowed
7 */
9 /*
10   In addition to this bug, the compiler permits overloading operator
11   delete in the class definition.  This is verboten, and should be
12   caught by a regression suite.  In other words, the following is also a
13   bug that's not caught:
17 #include <stdlib.h>
19 extern "C" 
21    int printf(const char*, ...);
26 class B
28  public:
29    int x;
30    virtual ~B() {}
31    void operator delete(void*,size_t s)
32   {
33       printf("B::delete() %d\n",s);
34    }
35    void operator delete(void*){}
38 int main()
40    B* p = new B;
41    delete p;
42    return 0;