OSDN Git Service

2005-07-23 Oyvind Harboe <oyvind.harboe@zylin.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / explicit74.C
1 // { dg-do run  }
2 // Reduced from a testcase by Yotam Medini <yotam@avanticorp.com>
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>(); }