xref: /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/g++.old-deja/g++.pt/explicit74.C (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1 // Reduced from a testcase by Yotam Medini <yotam@avanticorp.com>
2 
3 // egcs 1.1 seems to generate code that deletes a NULL pointer.
4 
5 template <class bar> struct foo { void fuz(); ~foo(); };
6 struct baz { int i; foo<baz> j; } *p = 0;
fuz()7 template <class bar> void foo<bar>::fuz() { delete p; }
~foo()8 template <class bar> foo<bar>::~foo() { delete p; }
9 template class foo<baz>;
main()10 int main() { foo<baz>(); }
11