Re: GCC6: implicit casting triggers error

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

 



On 04/02/16 13:44 +0100, Sandro Mani wrote:


On 04.02.2016 13:40, Jakub Jelinek wrote:
On Thu, Feb 04, 2016 at 01:36:50PM +0100, Sandro Mani wrote:
Med builds are failing with

medfile_int_wrap.cc:11272:30: error: no matching function for call to 'std::vector<double, std::allocator<double> >::erase(SwigValueWrapper<__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > > >&)'
   result = (arg1)->erase(arg2);


A standalone version which fails to compile (ignoring the fact that arg2 is not initialized):
---------------------

GCC 5 compiles the code. GCC6 seems to require an explicit cast, even though

std::vector<double>::iterator it = arg2;


works. GCC bug?
GCC 5 fails the same way if you compile with -std=c++11 or -std=c++14,
the latter is the default for GCC 6.
So in short, an explicit cast is needed?

Yes, with an explicit cast to vector<T>::iterator the code is valid in
C++03 and C++11. For the C++11 case only one implicit conversion will
be needed to get a const_iterator, so it will compile.
--
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.fedoraproject.org/admin/lists/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux