weird segfaults @ g++2.8.1, weird mis-linking egcs 1.1

Alexandre Oliva oliva@dcc.unicamp.br
Mon Oct 12 06:30:00 GMT 1998


Yotam Medini <yotam@avanticorp.com> writes:

> Hello
> Segmentation Fault

Can you recognize this code:

template <class bar> struct foo { void fuz(); ~foo(); };
struct baz { int i; foo<baz> j; } *p = 0;
template <class bar> void foo<bar>::fuz() { delete p; }
template <class bar> foo<bar>::~foo() { delete p; }
template class foo<baz>;
int main() { foo<baz>(); }

Believe me, it is a simplification of your testcase, that I'm
installing in the testsuite.  IMO, it gives a new meaning to the
military expression `fubar' :-)

Thanks for your report.

> /home/seg/yotam/build/egcs/Solaris/bin/g++ -g -Wl,-R/home/seg/yotam/build/egcs/Solaris/lib -o sp.new sp.o tpl.o 2>&1 | \
> 	tee link.err | /home/seg/yotam/build/egcs/Solaris/bin/c++filt
> sp.o: In function `WbReferenceCount::unique(void) const':
> /home/yotam/work/depict/front/tdf/SP/tst/WbPointer.hh:16: undefined reference to `ostream::operator<<(ostream &(*)(ostream &))'
> /home/yotam/work/depict/front/tdf/SP/tst/WbPointer.hh:16: undefined reference to `ostream::operator<<(ostream &(*)(ostream &))'

I couldn't reproduce this problem; are you sure it doesn't have
anything to do with a wrong library path?

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



More information about the Gcc-bugs mailing list