bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

error in g++, snapshot 20010108


From: Maurizio Loreti
Subject: error in g++, snapshot 20010108
Date: 10 Jan 2001 14:36:12 +0100

Hello -
In my relentless search for an usable snapshot of a current g++ with a
modern standard library, I have downloaded and installed the last
snapshot dated 20010108.  When I tried to compile a program of mine, I
had what I think is due to a bug in the standard library.  Here it is,
reduced to a minimal length of 7 lines of code:

address@hidden 14 $ cat bar.cxx
#include <memory>
#include <string>
#include <vector>
#include <fstream>

int main() {
  std::auto_ptr< std::vector<std::string> > a( new std::vector<std::string> );
}
address@hidden 15 $ g++ -o bar bar.cxx
bar.cxx: In function `int main()':
bar.cxx:7: call of overloaded `vector()' is ambiguous
/usr/local/gcc/include/g++-v3/bits/stl_vector.h:252: candidates are: 
   std::vector<_Tp, _Alloc>::vector(unsigned int = 0) [with _Tp = string, 
   _Alloc = std::allocator<string>]
/usr/local/gcc/include/g++-v3/bits/stl_vector.h:244:                 
   std::vector<_Tp, _Alloc>::vector(typename std::_Vector_base<_Tp, 
   _Alloc>::allocator_type& = typename std::_Vector_base<_Tp, 
   _Alloc>::allocator_type()) [with _Tp = string, _Alloc = 
   std::allocator<string>]
address@hidden 16 $

In case somebody wonders why I have #included <fstream>, well, if you
do not #include <fstream> the bug disappears :-)

I hope that bug report may be useful to the developers of g++ and/or
of the standard library.  And I hope to find some week an usable
snapshot, if not a brand new g++ version 3.

-- 
Maurizio Loreti                         http://www.pd.infn.it/~loreti/mlo.html
Univ. of Padova, Dept. of Physics - Padova, Italy            address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]