This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16915] unnecessary copy construction
- From: "boris at kolpackov dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Aug 2004 15:21:58 -0000
- Subject: [Bug c++/16915] unnecessary copy construction
- References: <20040807183433.16915.boris@kolpackov.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From boris at kolpackov dot net 2004-08-09 15:21 -------
pinskia at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org> writes:
> Invalid as "operator lock_<mutex>" returns a temporary so the
> lock_base l(temp) requires that the copy constructor to be accessible.
According to ([dcl.init.ref]/5, bullet 2, sub-bullet 1) it should be
lock_(lock_ const&), not lock_base(lock_base const&). As you can see
lock_(lock_ const&) is accessible.
Also what is so special about this case that gcc does not eliminate
the temporary?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16915