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


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