This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/21631] diagnostic for a non constant reference when passed a non lvalue (copy constructor)


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]