2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / bad-error6.C
blob40e2b99eb74530af2bb6df5a5ba866fd76409849
1 // { dg-do assemble  }
2 // GROUPS passed bad-errors
3 typedef __SIZE_TYPE__ size_t;
5 class tt {
6     public:
7     tt(int);
9     private:
10     void *operator new(size_t a); // Forbid object creation in heap memory.
13 void st(const tt&, int);
15 void ff(int i, int j)
17     if( i > 0 ) {
18         // This work ok.
19         tt a_tt(i);
20         st(a_tt, j);
21     }
22     else {
23         // This triggers an error because of private operator new ????.
24         st(tt(-i), j);
25     }