[cxx-abi-dev] Passing non-trivial types through ...

John McCall rjmccall at apple.com
Wed Aug 13 22:01:26 UTC 2014


On Aug 13, 2014, at 2:51 PM, Jason Merrill <jason at redhat.com> wrote:
> On 08/13/2014 05:38 PM, Dennis Handly wrote:
>> Did the customer say how he was going to accept it on the callee side?
> 
> My proposal is that this would all be handled transparently by the compiler, which knows which types need to be handled this way.
> 
>> aCC6 allows it with a warning but the results are unpredictable:
>> warning #3290-D:  Passing a non-POD object to a function with variable
>> arguments has undefined behavior.  Object will be copied onto
>> the stack instead of using a constructor.
>> 
>> (This is a bitwise copy.)
> 
> Ah, so my proposal would be incompatible with the current aCC behavior.  Hmm.

I agree that this is a problem; we shouldn't “standardize" something that a vendor doesn’t feel they can reasonably adopt.

We could document it as a recommendation, I suppose.

Out of curiosity, how does aCC handle destruction of the argument?  Does it call the destructor at the argument's original location or its new location in the arguments area?

John.


More information about the cxx-abi-dev mailing list