In answering a question about passing non-trivial types through ..., I
discovered a misleading comment. It is NOT just like a value parm,
because we don't locally copy it.
class X { ..,non-poddy... };
void Foo (X, ...);
void bin (X &p)
{
Foo (p, p);
}
Only the first arg to Foo goes via a copy-constructor.
Fixed thusly and applied.
nathan
--
Nathan Sidwell
2017-10-04 Nathan Sidwell <nat...@acm.org>
* call.c (convert_arg_to_ellipsis): Correct comment about passing
by reference.
Index: call.c
===================================================================
--- call.c (revision 253409)
+++ call.c (working copy)
@@ -7178,8 +7178,9 @@ convert_arg_to_ellipsis (tree arg, tsubs
with no corresponding parameter is conditionally-supported, with
implementation-defined semantics.
- We support it as pass-by-invisible-reference, just like a normal
- value parameter.
+ We support it as pass-by-invisible-reference to the caller's
+ object. That's different to named by-value parameters, which
+ construct a copy and pass a reference to that.
If the call appears in the context of a sizeof expression,
it is not potentially-evaluated. */