[Bug c++/25231] Compiler error for copy constructor with non const input
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Dec 2 20:53:00 GMT 2005
------- Comment #1 from pinskia at gcc dot gnu dot org 2005-12-02 20:53 -------
This is expected and how C++ works.
t1(t1& tr);
is a copy constructor which only takes references which means it only takes
lvalues.
t1 dosomething(const t1& v) const;
That means it returns a variable and calling that function and the result is
not an lvalue so there is no way to bind the return value to a reference.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25231
More information about the Gcc-bugs
mailing list