[Bug c++/43127] Inconsistent and odd constructor calls.
stvwooddell at embarqmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Feb 20 18:01:00 GMT 2010
------- Comment #2 from stvwooddell at embarqmail dot com 2010-02-20 18:01 -------
This compiles for you?
virtual ptr clone () const
{
return new object(*this);
}
gives me the error that a function matching the copy constructor does not
exist:
n file included from ../objects/map.cpp:27:
../objects/../include/object.hpp: In member function Âvirtual auto_ptr<object>
object::clone() constÂ:
../objects/../include/object.hpp:80: error: no matching function for call to
Âauto_ptr<object>::auto_ptr(auto_ptr<object>)Â
../objects/../include/global.hpp:73: note: candidates are:
auto_ptr<type>::auto_ptr(auto_ptr<type>&) [with type = object]
../objects/../include/global.hpp:71: note:
auto_ptr<type>::auto_ptr(type*) [with type = object]
make: *** [objects/map.o] Error 1
It is my understanding that all the forms should work by creating a (anonymous)
object, then call the copy constructor passing that object as it's only
argument.
In what gcc version or configuration does it work?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43127
More information about the Gcc-bugs
mailing list