This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: copy ctor not called
Hi Jeroen,
>To me this says, that I -fno-elide-constructors should be the default behavior. Which it isn't (at least for gcc 3.3.4).
Due to the design and evolution of C++, your expectation that "-fno-elide-constructors should be the default behavior" is not the case.
I can understand where a person would expect that to be the situation.
However, C++ standard has the elide "optimization" be the default behavior for proper C++, and the -fno-elide-constructors is a non-compliant pessimization.
Moreso, you've touched up the (surprising?) requirement for the copy constructor to be public.
These C++ anachronisms are due in large part to the design and evolution of C++. They are legacy warts.
Sincerely,
--Eljay