This is the mail archive of the gcc@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]

Re: Passing temprary by reference requires copy constructor in 3.4?



On Nov 26, 2004, at 2:10 PM, Peter Cech wrote:


Hi,
a.cpp: In function `void caller2()':
a.cpp:16: error: `AnyEvent::AnyEvent(const AnyEvent&)' is private
a.cpp:29: error: within this context

Why gcc requires copy constructor in such situation?

It does not require the copy constructor, just requires it be accessible.
I would read the changes page for 3.4 which documents why this changed.
Mainly this is required by the C++ standard.


Thanks,
Andrew Pinski


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