Topic: Common compiler bug with static variab
Author: maxtal@physics.su.OZ.AU (John Max Skaller)
Date: Sun, 26 Jun 1994 22:29:28 GMT Raw View
In article <2u4f6k$qcg@engnews2.Eng.Sun.COM> ball@cygany.Eng.Sun.COM writes:
On eliding copy constructors ...
>
>I think that you are arguing about words, and whether or not this is explicitly
>allowed by the current language, I most certainly expect it to be allowed
>by the final language.
More strongly -- I have argued for direct initialisation
(copy not permitted). If the wording doesnt allow eliding
of copy constructors in cases where I would have mandated no
copy be permitted I'll get quite annoyed, since it introduces
gratuitous inefficiency into the language that perverts
library design.
The claim is the Standard will allow eliding or inserting
copy constructors (at least public ones) by the language
processor -- that is the DEFINITION of value of a class type
and is necessary for efficient code generation. It is
the argument raised agaist the (almost always) optimal
direct initialisation -- which is also much less confusing.
--
JOHN (MAX) SKALLER, INTERNET:maxtal@suphys.physics.su.oz.au
Maxtal Pty Ltd, CSERVE:10236.1703
6 MacKay St ASHFIELD, Mem: SA IT/9/22,SC22/WG21
NSW 2131, AUSTRALIA
Author: ball@cygany.Eng.Sun.COM (Mike Ball)
Date: 20 Jun 1994 16:13:08 GMT Raw View
In article 15326@mulga.cs.mu.OZ.AU, fjh@munta.cs.mu.OZ.AU (Fergus Henderson) writes:
> The constructor call which is being eliminated is a call to `X::X(const X&)'.
> But this constructor is not the constructor for the temporary, it's
> the constructor for `a'. The constructor for the temporary is `X::X()'.
> Hence the optimization being made is not allowed by the commentary in ARM
> 12.1c.
>
> [In fact, even if it was allowed by the commentary, this would be
> irrelevant as far as conformance to the ANSI/ISO working paper goes,
> Furthermore, even if you are only talking about compatibility with the
> ARM, when the commentary and the main text disagree, the main text must
> prevail. However this is all irrelevant since the compiler's behaviour
> is not allowed by the commentary anyway.]
As far as I can tell from discussions in the ANSI committee, whether or not it is
in the DWP or the ARM, it is the intent of the committee that such copies be
eliminated. The temporary that is being eliminated is the one generated by
A(), it it appears well within the bounds of the allowed optimizations to
eliminate it.
I think that you are arguing about words, and whether or not this is explicitly
allowed by the current language, I most certainly expect it to be allowed
by the final language.
Mike Ball
SunSoft.
Author: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Date: Fri, 24 Jun 1994 04:54:56 GMT Raw View
ball@cygany.Eng.Sun.COM (Mike Ball) writes:
>As far as I can tell from discussions in the ANSI committee, whether or
>not it is in the DWP or the ARM, it is the intent of the committee that
>such copies be eliminated.
>
>I think that you are arguing about words,
Well, yes, not having been to any committee meetings, (and not being a
mind-reader ;-), words are all that I have to go on.
>and whether or not this is explicitly
>allowed by the current language, I most certainly expect it to be allowed
>by the final language.
Fair enough.
--
Fergus Henderson - fjh@munta.cs.mu.oz.au