diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/destruct.C')
-rwxr-xr-x | gcc/testsuite/g++.old-deja/g++.jason/destruct.C | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/destruct.C b/gcc/testsuite/g++.old-deja/g++.jason/destruct.C new file mode 100755 index 0000000..c5b3be6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.jason/destruct.C @@ -0,0 +1,33 @@ +// Exhaustive test for destructors of simple types. +// PRMS Id: 2744, 3308 +// Build don't link: + +template <class T> class A { + T q; +public: + ~A() { + q.T::~T(); + q.~T(); + (&q)->T::~T(); + (&q)->~T(); + } +}; + +typedef char * cp; + +int main () +{ + A<int> a; + A<cp> b; + int i; + cp c; + + i.~int(); + i.int::~int(); + (&i)->~int(); + (&i)->int::~int(); + c.~cp(); + c.cp::~cp(); + (&c)->~cp(); + (&c)->cp::~cp(); +} |