This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Strange warning from stl_tree.h
- From: Wolfgang Bangerth <wolfgang dot bangerth at iwr dot uni-heidelberg dot de>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 11 Mar 2002 18:08:40 +0100 (MET)
- Subject: Strange warning from stl_tree.h
With today's gcc (head + 3.1 branch), I get the strange warning appended
below from this code:
#include <map>
#include <vector>
void f()
{
std::vector<std::map<unsigned int, double > > vm;
vm.resize (1);
};
Does anyone know what's going on? The code in question does not look
wrong...
Regards
Wolfgang
Here's the warning, too long to paste into the text of a mail :-)
atlas2/wolf> ~/Config/i686-pc-linux-gnu/gcc-ss/bin/c++ -c gcc31issue2.cc
-o /dev/null -W -Wall
/home/atlas2/wolf/Config/i686-pc-linux-gnu/gcc-ss/include/g++-v3/bits/stl_tree.h:
In
member function `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>&
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::operator=(const
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&) [with _Key =
unsigned int, _Val = std::pair<const unsigned int, double>, _KeyOfValue
=
std::_Select1st<std::pair<const unsigned int, double> >, _Compare =
std::less<unsigned int>, _Alloc = std::allocator<std::pair<const
unsigned
int, double> >]':
/home/atlas2/wolf/Config/i686-pc-linux-gnu/gcc-ss/include/g++-v3/bits/stl_map.h:143:
instantiated from `std::map<_Key, _Tp, _Compare, _Alloc>& std::map<_Key,
_Tp, _Compare, _Alloc>::operator=(const std::map<_Key, _Tp, _Compare,
_Alloc>&) [with _Key = unsigned int, _Tp = double, _Compare =
std::less<unsigned int>, _Alloc = std::allocator<std::pair<const unsigned
int, double> >]'
/home/atlas2/wolf/Config/i686-pc-linux-gnu/gcc-ss/include/g++-v3/bits/stl_algobase.h:517:
instantiated from `void std::fill(_ForwardIter, _ForwardIter, const _Tp&)
[with _ForwardIter = std::__normal_iterator<std::map<unsigned int, double,
std::less<unsigned int>, std::allocator<std::pair<const unsigned int,
double> > >*, std::vector<std::map<unsigned int, double,
std::less<unsigned int>, std::allocator<std::pair<const unsigned int,
double> > >, std::allocator<std::map<unsigned int, double,
std::less<unsigned int>, std::allocator<std::pair<const unsigned int,
double> > > > > >, _Tp = std::map<unsigned int, double, std::less<unsigned
int>, std::allocator<std::pair<const unsigned int, double> > >]'
/home/atlas2/wolf/Config/i686-pc-linux-gnu/gcc-ss/include/g++-v3/bits/stl_vector.h:961:
instantiated from `void std::vector<_Tp,
_Alloc>::_M_fill_insert(std::__normal_iterator<_Tp*, std::vector<_Tp,
_Alloc> >, unsigned int, const _Tp&) [with _Tp = std::map<unsigned int,
double, std::less<unsigned int>, std::allocator<std::pair<const unsigned
int, double> > >, _Alloc = std::allocator<std::map<unsigned int, double,
std::less<unsigned int>, std::allocator<std::pair<const unsigned int,
double> > > >]'
/home/atlas2/wolf/Config/i686-pc-linux-gnu/gcc-ss/include/g++-v3/bits/stl_vector.h:601:
instantiated from `void std::vector<_Tp,
_Alloc>::insert(std::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >,
unsigned int, const _Tp&) [with _Tp = std::map<unsigned int, double,
std::less<unsigned int>, std::allocator<std::pair<const unsigned int,
double> > >, _Alloc = std::allocator<std::map<unsigned int, double,
std::less<unsigned int>, std::allocator<std::pair<const unsigned int,
double> > > >]'
/home/atlas2/wolf/Config/i686-pc-linux-gnu/gcc-ss/include/g++-v3/bits/stl_vector.h:677:
instantiated from `void std::vector<_Tp, _Alloc>::resize(unsigned int,
const _Tp&) [with _Tp = std::map<unsigned int, double, std::less<unsigned
int>, std::allocator<std::pair<const unsigned int, double> > >, _Alloc =
std::allocator<std::map<unsigned int, double, std::less<unsigned int>,
std::allocator<std::pair<const unsigned int, double> > > >]'
/home/atlas2/wolf/Config/i686-pc-linux-gnu/gcc-ss/include/g++-v3/bits/stl_vector.h:689:
instantiated from `void std::vector<_Tp, _Alloc>::resize(unsigned int)
[with _Tp = std::map<unsigned int, double, std::less<unsigned int>,
std::allocator<std::pair<const unsigned int, double> > >, _Alloc =
std::allocator<std::map<unsigned int, double, std::less<unsigned int>,
std::allocator<std::pair<const unsigned int, double> > > >]'
gcc31issue2.cc:7: instantiated from here
/home/atlas2/wolf/Config/i686-pc-linux-gnu/gcc-ss/include/g++-v3/bits/stl_tree.h:954:
warning: value
computed is not used