gcc/testsuite/g++.old-deja/g++.pt/explicit74.C
raw| 1 | // { dg-do run } |
| 2 | // Reduced from a testcase by Yotam Medini <[email protected]> |
| 3 | |
| 4 | // egcs 1.1 seems to generate code that deletes a NULL pointer. |
| 5 | |
| 6 | template <class bar> struct foo { void fuz(); ~foo(); }; |
| 7 | struct baz { int i; foo<baz> j; } *p = 0; |
| 8 | template <class bar> void foo<bar>::fuz() { delete p; } |
| 9 | template <class bar> foo<bar>::~foo() { delete p; } |
| 10 | template class foo<baz>; |
| 11 | int main() { foo<baz>(); } |