Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.jason/dtor3.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 // { dg-do assemble } |
2 // PRMS Id: 5341 | |
3 // Bug: g++ complains about the explicit destructor notation. | |
4 | |
5 #include <stddef.h> | |
6 | |
7 void *operator new(size_t Size, void* pThing) { return pThing; } | |
8 | |
9 template <class T> class Stack { | |
10 public: | |
11 Stack() { new (Data) T(); } | |
12 ~Stack() { ((T*)Data)->~T(); } | |
13 private: | |
14 char Data[sizeof(T)]; | |
15 }; | |
16 | |
17 Stack<int> a; | |
18 Stack<Stack<int> > c; |