This is the mail archive of the gcc-bugs@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: cannot pass objects of non-POD type [] through '...'


> nope. [18.7/3]
>   If the parmeter parmN [stream in this case] is declared with a function,
> array or reference type, or with a type that is not compatible with the
> type that results when passing an argument for which there is no
> parameter,
> the behaviour is undefined.

Nathan,

if I got you right, this happen's because I'm passing a reference to the
ostream object.
> ostream& func(ostream &stream, ...)

But, sorry, why in heavens sake this result's in undefined behaviour?
Is it really coincidence that it works like expected when gcc eventually
builds a binary? May it stall in, say 5 of 100, sucessive runs?

So, in short: I simply have to redesign my app to avoid this?

regards
	Daniel



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