[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    Re: Is that a bug?
From:       "Martin v. Loewis" <martin () mira ! isdn ! cs ! tu-berlin ! de>
Date:       1999-03-31 21:54:03
[Download RAW message or body]

> which seems to be quite strange, since there were no earlier errors.
> The bug appeared in a quite complicated context, I stripped it down to
> this piece of code and hope you can reproduce (and fix? :-) ) it.

Thanks for your report. This is a real bug. With egcs-2.93.13, I get

/usr/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.13/../../../../include/g++-2/stl_algobase.h: \
                In method `class foo & foo::operator =(const foo &)':
/usr/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.13/../../../../include/g++-2/stl_algobase.h:239: \
instantiated from `__copy_backward<foo *, foo *, ptrdiff_t>(foo *, foo *, foo *, \
                random_access_iterator_tag, ptrdiff_t *)'
/usr/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.13/../../../../include/g++-2/stl_algobase.h:262: \
instantiated from `__copy_backward_dispatch<foo *,foo *,__false_type>::copy(foo *, \
                foo *, foo *)'
/usr/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.13/../../../../include/g++-2/stl_algobase.h:291: \
                instantiated from `copy_backward<foo *, foo *>(foo *, foo *, foo *)'
/usr/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.13/../../../../include/g++-2/stl_vector.h:594: \
                instantiated from `vector<foo,allocator<foo> >::_M_insert_aux(foo *, \
                const foo &)'
/usr/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.13/../../../../include/g++-2/stl_vector.h:325: \
                instantiated from here
/usr/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.13/../../../../include/g++-2/stl_algobase.h:239: \
non-static reference member `class vector<int,allocator<int> > & foo::intvec', can't \
use default assignment operator

which indicates that the bug is fixed and also indicates the error in
your code: you can't have a reference member and default assignment at
the same time, yet push_back requires copy-assignment to work.

Hope this helps,
Martin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic