This is the mail archive of the gcc-patches@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: RFC: PATCH to allow passing non-trivial types through ...


On 08/11/14 14:02, Jason Merrill wrote:
A customer was recently complaining about G++ rejecting code that tries to pass
a type with a non-trivial copy constructor through ..., which is undefined in
C++98 and conditionally-supported in C++11.  In GCC 3.1 and below we gave a
warning and then did a bitwise copy.  From GCC 3.2 to 4.4 we gave a warning and
then aborted at runtime.  From 4.5 on we have just given an error.

On considering the request, it occurred to me that we could handle variadic
arguments of non-trivial types the same way we handle normal value arguments of
such types: pass by invisible reference.  So this patch implements that.  Since
it's been so long since this was allowed at all, I don't think we need to worry
about ABI incompatibility with the 3.1 behavior.

Thoughts?

Sounds sensible to me.

nathan
--
Nathan Sidwell


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