| 1 |
// { dg-do assemble } |
| 2 |
// GROUPS passed operators |
| 3 |
// (Message bugs/opr-del:4) |
| 4 |
// From: [email protected] (Jamshid Afshar) |
| 5 |
// Date: Fri, 25 Feb 94 18:44:01 CST |
| 6 |
// Subject: Re: delete on "smart pointers" |
| 7 |
// Message-ID: <9402262328.AA16321@pancake> |
| 8 |
// |
| 9 |
// Who was apparently replying to [email protected] |
| 10 |
|
| 11 |
|
| 12 |
template<class T> class Ptr { |
| 13 |
public: |
| 14 |
Ptr(T*); |
| 15 |
operator T*(); |
| 16 |
}; |
| 17 |
|
| 18 |
int main() { |
| 19 |
Ptr<int> ip = new int(2); |
| 20 |
delete ip; |
| 21 |
operator delete(ip); |
| 22 |
return 0; |
| 23 |
} |