[Bug c++/18113] compiler allows 2 copy constructors
profvonsully at yahoo dot com
gcc-bugzilla@gcc.gnu.org
Tue Oct 26 18:41:00 GMT 2004
------- Additional Comments From profvonsully at yahoo dot com 2004-10-26 18:41 -------
there is another example for those that did not look at the attachment(sorry
for my initial language):
class TObject;
typedef TObject& rObject;
class TObject
{
public:
TObject(){}
TObject(const rObject){}//the compiler does NOT realize that this is
a copy constructor
// TObject(const TObject&){} the compiler wants this to be a copy
constructor
// "error: no matching function for call to
`TObject::TObject(TObject)'" :)))))))
//I am profvonsully@yahoo.com
};
TObject GetAnObject()
{
TObject AnObject;
return AnObject;
}
void HandleObject(TObject toj)
{
}
void errors_are_here()
{
HandleObject
(
GetAnObject()
);/*here g++ says an error exists*/
}
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18113
More information about the Gcc-bugs
mailing list