This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Template regression


I have some rather long code (available as 
ftp://bonnie.liafa.jussieu.fr/pub/espie/bi.tgz) that exhibits some
template regression.

It compiles fine under egcs-2.91.22 980404, alpha-dec-osf4.0a,
but fails under egcs-2.91.28 19980508, i686-pc-linux-gnu.

I can't check if the failure is the same under alpha-dec-osf4.0a,
as recent snapshots don't compile.

Anyway, compiling with -Wall -g -frepo, I get the following error messages:
test_neural.o:/usr/local/egcs/include/g++/stl_algobase.h:180: undefined
reference to `vector<double, __default_alloc_template<true, 0>
>::insert_aux(double *, double const &)'
test_neural.o:/usr/local/egcs/include/g++/stl_algobase.h:180: undefined
reference to `vector<unsigned int, __default_alloc_template<true, 0>
>::insert_aux(unsigned int *, unsigned int const &)'
neural.o: In function `Network<Simple>::Network(vector<unsigned int,
__default_alloc_template<true, 0> > const &)':
/home/espie/qv/reseau/z/neural.C:131: undefined reference to
`Neuron<Simple>::Neuron(Network<Simple> const &, vector<unsigned int,
__default_alloc_template<true, 0> > const &)'
/home/espie/qv/reseau/z/neural.C:142: undefined reference to
`Neuron<Simple>::Neuron(Network<Simple> const &, vector<unsigned int,
__default_alloc_template<true, 0> > const &)'
neural.o: In function `Neuron<Simple>::dump(void) const':
/home/espie/qv/reseau/z/neural.C:169: undefined reference to
`const_mem_fun_t<void, Link<Simple> > for_each<Link<Simple> *const *,
const_mem_fun_t<void, Link<Simple> > >(Link<Simple> *const *, Link<Simple>
*const *, const_mem_fun_t<void, Link<Simple> >)'
neural.o:/home/espie/qv/reseau/z/neural.C:23: undefined reference to
`vector<Neuron<Simple> *, __default_alloc_template<true, 0>
>::insert_aux(Neuron<Simple> **, Neuron<Simple> *const &)'
collect2: ld returned 1 exit status


>From the first error, it looks as if
template<class T, class Alloc>
void vector<T, Alloc>::insert_aux(iterator position, const T& x)

(from stl_vector.h, line 323) never gets instantiated, even though the 
preprocessed files clearly show it's there...
-- 
	Marc Espie		
|anime, sf, juggling, unicycle, acrobatics, comics...
|AmigaOS, OpenBSD, C++, perl, Icon, PostScript...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]