Passing NON-POD type to Variadic function is undefined behavior? Passing NON-POD type to Variadic function is undefined behavior? c c

Passing NON-POD type to Variadic function is undefined behavior?


It's specified in C++11 5.2.2/7:

Passing a potentially-evaluated argument of class type having a non-trivial copy constructor, a non-trivial move contructor, or a non-trivial destructor, with no corresponding parameter, is conditionally-supported with implementation-defined semantics.

So it's up to each compiler whether to support it or not; portable code can't rely on any implementation defined behaviour. In older standards, it was simply undefined.