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++/16915] unnecessary copy construction


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


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