1 // { dg-do assemble } 2 // PRMS Id: 5341 3 // Bug: g++ complains about the explicit destructor notation. 4 5 #include <stddef.h> 6 new(size_t Size,void * pThing)7void *operator new(size_t Size, void* pThing) { return pThing; } 8 9 template <class T> class Stack { 10 public: Stack()11 Stack() { new (Data) T(); } ~Stack()12 ~Stack() { ((T*)Data)->~T(); } 13 private: 14 char Data[sizeof(T)]; 15 }; 16 17 Stack<int> a; 18 Stack<Stack<int> > c; 19