This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21631] diagnostic for a non constant reference when passed a non lvalue (copy constructor)
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2005 20:17:37 -0000
- Subject: [Bug c++/21631] diagnostic for a non constant reference when passed a non lvalue (copy constructor)
- References: <20050517195554.21631.pkoning@equallogic.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-17 20:17 -------
Note T(T&) is still a copy constructor, just not one which takes a constant reference.
Also note:
it really bolls down to this testcase:
int f(int&);
int f();
int g(void)
{
return f(1);
}
If we get rid of the second f function, we get a good warning.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21631