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: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Aug 2004 15:29:47 -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 bangerth at dealii dot org 2004-08-09 15:29 -------
lock::lock(const lock&) tries to use the copy constructor
of the base class, but that is inaccessible.
What the standard says is basically that the copy constructor
must be accessible. Whether the compiler actually uses it, or gets
rid of the temporary by direct copy, is up to the compiler implementation,
but it has to check the accessibility anyway. gcc doesn't generate the
temporary in many cases, btw.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16915