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]

gcc-2.97 20010109: gcc assumes default argument in constructor where it's not specified


In following example (see attached precompiled source) gcc-2.97 20010109 I'm getting 
following compiler errors:

lasdata/amu_cal.cc: In constructor `AmuCalibr::AmuCalibr(const string&, 
   double)':
lasdata/amu_cal.cc:63: call of overloaded `vector()' is ambiguous
/disk2/gcctest/include/g++-v3/bits/stl_vector.h:252: candidates are: 
   std::vector<_Tp, _Alloc>::vector(unsigned int = 0) [with _Tp = AmuMeasPoint, 
   _Alloc = std::allocator<AmuMeasPoint>]
/disk2/gcctest/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 = AmuMeasPoint, _Alloc = 
   std::allocator<AmuMeasPoint>]

At line 252 in bits/stl_vector I have

  explicit vector(size_type __n)
    : _Base(__n, allocator_type())
    { _M_finish = uninitialized_fill_n(_M_start, __n, _Tp()); }

So no default argument in this constructor and as result there should be no 
ambiguity. I failed to reproduce this problem in smaller example so I'm including 
full preprocessed source (sorry for size)

Andris




amu_cal.ii.bz2


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