This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
#include <fstream> causes "call of overloaded `vector()' is ambiguous"
- To: <libstdc++ at gcc dot gnu dot org>, <gcc-bugs at gcc dot gnu dot org>
- Subject: #include <fstream> causes "call of overloaded `vector()' is ambiguous"
- From: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Date: Fri, 22 Dec 2000 16:01:17 +0100 (CET)
When compiling the following snippet with current GCC with libstdc++-v3
#include <vector>
#include <fstream> // This is causing troubles!
class STACK {
public:
std::vector<int> data;
STACK() : data()
{ }
};
I'm seeing the following error message IF AND ONLY IF <fstream>, which
is not needed at all, is #included:
% gccvs x.cc
x.cc: In constructor `STACK::STACK()':
x.cc:9: call of overloaded `vector()' is ambiguous
/sw/test/gcc/SunOS/include/g++-v3/bits/stl_vector.h:252: candidates are:
std::vector<_Tp, _Alloc>::vector(unsigned int = 0) [with _Tp = int,
_Alloc = std::allocator<int>]
/sw/test/gcc/SunOS/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 = int, _Alloc = std::allocator<int>]
Gerald
PS: Generating this minimal test case took me about an hour. :-(
--
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/