[Bug c++/50285] no known conversion for argument 1: 'X' to 'X&'
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Sep 4 18:07:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50285
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2011-09-04
Ever Confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-04 18:06:54 UTC ---
An error message is not a bug, please follow the bug reporting instructions and
provide source code for a testcase demonstrating your problem:
http://gcc.gnu.org/bugs/
The message clearly isn't about converting a type to itself, it's about
converting a type to a non-const lvalue reference to that type (X is not the
same as X&)
I assume it means you're trying to pass an rvalue (e.g. a temporary) to a
function that requires an lvalue
e.g. this produces a similar error
struct X {
X& operator=(X&);
};
X f();
void g()
{
X x;
x = f();
}
More information about the Gcc-bugs
mailing list