* [Bug c++/25950] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
@ 2006-01-24 22:38 ` pinskia at gcc dot gnu dot org
2006-01-24 22:48 ` [Bug c++/25950] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
` (31 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-24 22:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-01-24 22:38 -------
I am going to mark this depending on PR 12226 for a second since that is the PR
12226 which made promoted this change.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |12226
Known to fail| |3.4.0 4.0.0 4.1.0
Known to work| |3.3.3 3.2.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
2006-01-24 22:38 ` [Bug c++/25950] [DR 391] " pinskia at gcc dot gnu dot org
@ 2006-01-24 22:48 ` pinskia at gcc dot gnu dot org
2006-01-24 22:51 ` hhinnant at apple dot com
` (30 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-24 22:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-01-24 22:48 -------
I am going to mark this a regression but not confirm it because I don't
understand this issue fully and this seems like someone else who knows better
about this should do that.
CCing Mark as he did the change for PR 12226.
Adding the URL for the DR report for lazy people (me):
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#391
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmitchel at gcc dot gnu dot
| |org
Known to work|3.3.3 3.2.3 |3.3.3 3.2.3 2.95.3 3.0.4
Summary|[DR 391] Reference binding |[3.4/4.0/4.1 Regression] [DR
|and explicit copy |391] Reference binding and
|constructors |explicit copy constructors
Target Milestone|--- |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
2006-01-24 22:38 ` [Bug c++/25950] [DR 391] " pinskia at gcc dot gnu dot org
2006-01-24 22:48 ` [Bug c++/25950] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2006-01-24 22:51 ` hhinnant at apple dot com
2006-01-25 1:32 ` gdr at cs dot tamu dot edu
` (29 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: hhinnant at apple dot com @ 2006-01-24 22:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from hhinnant at apple dot com 2006-01-24 22:51 -------
More information:
I now believe I unknowingly misled when I surmized that EDG had implemented cwg
391. If you declare the copy ctor private in the example, EDG rejects g(X())
based on accessibility. Rather I am now surmizing that there is wiggle room in
8.5.3 to allow EDG's behavior. More specifically, EDG is choosing this bullet:
* The reference is bound to the object represented by the rvalue (see
basic.lval) or to a sub-object within that object.
And (I'm still guessing) this choice requires access checking of the copy ctor,
but does not require an implicit copy ctor. Sorry my initial post wasn't more
clear. This is a confusing area to me.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (2 preceding siblings ...)
2006-01-24 22:51 ` hhinnant at apple dot com
@ 2006-01-25 1:32 ` gdr at cs dot tamu dot edu
2006-01-25 1:55 ` pinskia at gcc dot gnu dot org
` (28 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: gdr at cs dot tamu dot edu @ 2006-01-25 1:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from gdr at cs dot tamu dot edu 2006-01-25 01:32 -------
Subject: Re: [3.4/4.0/4.1 Regression] [DR 391] Reference binding and explicit
copy constructors
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| I am going to mark this a regression but not confirm it because I don't
before you declare something as a regression, please make sure you do
understand the real issues. When you don't fully understand, please
leave it alone and help somewhere else. Thanks.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (3 preceding siblings ...)
2006-01-25 1:32 ` gdr at cs dot tamu dot edu
@ 2006-01-25 1:55 ` pinskia at gcc dot gnu dot org
2006-01-25 2:05 ` hhinnant at apple dot com
` (27 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-25 1:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-01-25 01:55 -------
(In reply to comment #4)
> before you declare something as a regression, please make sure you do
> understand the real issues. When you don't fully understand, please
> leave it alone and help somewhere else. Thanks.
Well Marking things as regression is easy as it is just easy to test it on
different versions of GCC which I did. Now figuring out what we should do here
is not up to me which is why I did not confirm it. Now I read the DR and the
standard (well I did read it for the bug linked here) but it seems like the DR
only resolves one part of the question but it seems raise differnet questions
for me which is why I left it unconfirmed. Should have I written this first,
maybe but then again you would have harped on me anyways. If you noticed I
gave some back ground info on when the change happened and CCed the person who
changed it to get a clarification (in fact I said that in comment #2). I
linked to the DR report so that people could easier access to it instead of
remembering the link each time when comming to this bug. (and now this whole
thing is offtopic from the bug report).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (4 preceding siblings ...)
2006-01-25 1:55 ` pinskia at gcc dot gnu dot org
@ 2006-01-25 2:05 ` hhinnant at apple dot com
2006-01-25 2:38 ` gdr at cs dot tamu dot edu
` (26 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: hhinnant at apple dot com @ 2006-01-25 2:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from hhinnant at apple dot com 2006-01-25 02:05 -------
At the risk of continuing off-topic...
Thank you Andrew for your continuing prompt and high quality work. It is a
very valuable service and I've never had any complaints with the way you
provide it. Good Job and Thank You!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (5 preceding siblings ...)
2006-01-25 2:05 ` hhinnant at apple dot com
@ 2006-01-25 2:38 ` gdr at cs dot tamu dot edu
2006-01-25 2:41 ` [Bug c++/25950] [3.4/4.0/4.1] " gdr at gcc dot gnu dot org
` (25 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: gdr at cs dot tamu dot edu @ 2006-01-25 2:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from gdr at cs dot tamu dot edu 2006-01-25 02:38 -------
Subject: Re: [3.4/4.0/4.1 Regression] [DR 391] Reference binding and explicit
copy constructors
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| (In reply to comment #4)
| > before you declare something as a regression, please make sure you do
| > understand the real issues. When you don't fully understand, please
| > leave it alone and help somewhere else. Thanks.
|
| Well Marking things as regression is easy as it is just easy to test it on
| different versions of GCC which I did.
No, it is not that simple.
For example consider access checking (which this issue is about). For
a long time, GCC has been known to be buggy on access checking,
therefore *wrongly* accepting codes it should reject (for example is
the PR you referenced.) That was fixed by checking the accessibility
of the copy constructor even when it is elided (as required by the
C++ standard).
The C++ Working Paper has been slightly changed recently -- but not
the C++ standard -- to be somehow more permissisive in specific cases.
This PR is based on the hypothesis that the working paper stays as it
is on that point till we get the standard.
The proper categorization is that this is a request for enhancement.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (6 preceding siblings ...)
2006-01-25 2:38 ` gdr at cs dot tamu dot edu
@ 2006-01-25 2:41 ` gdr at gcc dot gnu dot org
2006-01-25 2:54 ` hhinnant at apple dot com
` (24 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: gdr at gcc dot gnu dot org @ 2006-01-25 2:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from gdr at gcc dot gnu dot org 2006-01-25 02:41 -------
Changing to request for enhancement. The requested behaviour is a change
in th working paper. Existing behaviour is what is required by the standard
(even when it can be argued that checking for something that is elided is
suboptimal.)
--
gdr at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gdr at gcc dot gnu dot org
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-01-25 02:41:25
date| |
Summary|[3.4/4.0/4.1 Regression] [DR|[3.4/4.0/4.1] [DR 391]
|391] Reference binding and |Reference binding and
|explicit copy constructors |explicit copy constructors
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (7 preceding siblings ...)
2006-01-25 2:41 ` [Bug c++/25950] [3.4/4.0/4.1] " gdr at gcc dot gnu dot org
@ 2006-01-25 2:54 ` hhinnant at apple dot com
2006-01-25 3:03 ` [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 152] " pinskia at gcc dot gnu dot org
` (23 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: hhinnant at apple dot com @ 2006-01-25 2:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from hhinnant at apple dot com 2006-01-25 02:54 -------
(In reply to comment #8)
> Changing to request for enhancement. The requested behaviour is a change
> in th working paper. Existing behaviour is what is required by the standard
> (even when it can be argued that checking for something that is elided is
> suboptimal.)
Did you read comment 3?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 152] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (8 preceding siblings ...)
2006-01-25 2:54 ` hhinnant at apple dot com
@ 2006-01-25 3:03 ` pinskia at gcc dot gnu dot org
2006-01-25 3:10 ` gdr at cs dot tamu dot edu
` (22 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-25 3:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pinskia at gcc dot gnu dot org 2006-01-25 03:03 -------
So this really just DR 152 and has nothing to do with DR 391 except misleading
us. DR 152 is TR1 so it is part of the standard, therefor this is still a
regression and should be marked as normal severity.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|enhancement |normal
Summary|[3.4/4.0/4.1] [DR 391] |[3.4/4.0/4.1 Regression] [DR
|Reference binding and |152] Reference binding and
|explicit copy constructors |explicit copy constructors
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 152] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (9 preceding siblings ...)
2006-01-25 3:03 ` [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 152] " pinskia at gcc dot gnu dot org
@ 2006-01-25 3:10 ` gdr at cs dot tamu dot edu
2006-01-25 3:20 ` gdr at cs dot tamu dot edu
` (21 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: gdr at cs dot tamu dot edu @ 2006-01-25 3:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from gdr at cs dot tamu dot edu 2006-01-25 03:09 -------
Subject: Re: [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy
constructors
"hhinnant at apple dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| ------- Comment #9 from hhinnant at apple dot com 2006-01-25 02:54 -------
| (In reply to comment #8)
| > Changing to request for enhancement. The requested behaviour is a change
| > in th working paper. Existing behaviour is what is required by the
standard
| > (even when it can be argued that checking for something that is elided is
| > suboptimal.)
|
| Did you read comment 3?
Yes. Is your claim that whether the copy constructor is converting or
not does not matter?
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1 Regression] [DR 152] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (10 preceding siblings ...)
2006-01-25 3:10 ` gdr at cs dot tamu dot edu
@ 2006-01-25 3:20 ` gdr at cs dot tamu dot edu
2006-01-25 3:20 ` [Bug c++/25950] [3.4/4.0/4.1] [DR 392] " gdr at gcc dot gnu dot org
` (20 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: gdr at cs dot tamu dot edu @ 2006-01-25 3:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from gdr at cs dot tamu dot edu 2006-01-25 03:20 -------
Subject: Re: [3.4/4.0/4.1 Regression] [DR 152] Reference binding and explicit
copy constructors
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| So this really just DR 152
No!
DR 152 is about what happens when you pass an argument by value and
the copy-constructor happens to be explicit. DR 152 says that well,
you loose -- the copy-constructor is a converting constructor and if
it is explicit, then the pass-by-value fails. Read the last sentence
of bullet 1 and bullet 2 carefully.
| and has nothing to do with DR 391 except misleading us.
It is exactly the opposite. DR 152 is a distraction.
The PR is about
| DR 152 is TR1
if it were TR1, it would not have been the C++ standard. It is TC1,
but again this issue is NOT about DR 152. It is about DR 391 and
and related aspect.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 392] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (11 preceding siblings ...)
2006-01-25 3:20 ` gdr at cs dot tamu dot edu
@ 2006-01-25 3:20 ` gdr at gcc dot gnu dot org
2006-01-25 3:24 ` hhinnant at apple dot com
` (19 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: gdr at gcc dot gnu dot org @ 2006-01-25 3:20 UTC (permalink / raw)
To: gcc-bugs
--
gdr at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Last reconfirmed|2006-01-25 02:41:25 |2006-01-25 03:20:53
date| |
Summary|[3.4/4.0/4.1 Regression] [DR|[3.4/4.0/4.1] [DR 392]
|152] Reference binding and |Reference binding and
|explicit copy constructors |explicit copy constructors
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 392] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (12 preceding siblings ...)
2006-01-25 3:20 ` [Bug c++/25950] [3.4/4.0/4.1] [DR 392] " gdr at gcc dot gnu dot org
@ 2006-01-25 3:24 ` hhinnant at apple dot com
2006-01-25 3:28 ` [Bug c++/25950] [3.4/4.0/4.1] [DR 391] " gdr at gcc dot gnu dot org
` (18 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: hhinnant at apple dot com @ 2006-01-25 3:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from hhinnant at apple dot com 2006-01-25 03:24 -------
(In reply to comment #11)
> | Did you read comment 3?
>
> Yes. Is your claim that whether the copy constructor is converting or
> not does not matter?
No. My suspicion is that there is a 99.99% chance that EDG is conforming to
C++03 in this regard. And furthermore, their behavior (which is different from
ours) is preferable to our customers.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (13 preceding siblings ...)
2006-01-25 3:24 ` hhinnant at apple dot com
@ 2006-01-25 3:28 ` gdr at gcc dot gnu dot org
2006-01-25 3:35 ` pinskia at gcc dot gnu dot org
` (17 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: gdr at gcc dot gnu dot org @ 2006-01-25 3:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from gdr at gcc dot gnu dot org 2006-01-25 03:28 -------
DR 391, not 392. My typo.
--
gdr at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|enhancement |normal
Summary|[3.4/4.0/4.1] [DR 392] |[3.4/4.0/4.1] [DR 391]
|Reference binding and |Reference binding and
|explicit copy constructors |explicit copy constructors
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (14 preceding siblings ...)
2006-01-25 3:28 ` [Bug c++/25950] [3.4/4.0/4.1] [DR 391] " gdr at gcc dot gnu dot org
@ 2006-01-25 3:35 ` pinskia at gcc dot gnu dot org
2006-01-25 3:41 ` gdr at cs dot tamu dot edu
` (16 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-25 3:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from pinskia at gcc dot gnu dot org 2006-01-25 03:34 -------
Actually DR 152 clarifies that this is invalid code. as Per 8.5/12 this is
copy-initialization.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (15 preceding siblings ...)
2006-01-25 3:35 ` pinskia at gcc dot gnu dot org
@ 2006-01-25 3:41 ` gdr at cs dot tamu dot edu
2006-01-25 6:46 ` mmitchel at gcc dot gnu dot org
` (15 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: gdr at cs dot tamu dot edu @ 2006-01-25 3:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from gdr at cs dot tamu dot edu 2006-01-25 03:40 -------
Subject: Re: [3.4/4.0/4.1] [DR 392] Reference binding and explicit copy
constructors
"hhinnant at apple dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| (In reply to comment #11)
| > | Did you read comment 3?
| >
| > Yes. Is your claim that whether the copy constructor is converting or
| > not does not matter?
|
| No. My suspicion is that there is a 99.99% chance that EDG is conforming to
| C++03 in this regard.
Further investigation reveals this: If an implementation chooses the
second bullet (where it elects to copy the temporary to another
temporary) what is the semantics? Is it copy-initialization as
everywhere else in argument pass-by-value? Or is it
direct-initialization? That is what my question meant. GCC always
uses copy-initialization in function argument passing, except when the
parameter directly binds, i.e. no temporary is needed.
| And furthermore, their behavior (which is different from
| ours) is preferable to our customers.
I think I know where this PR comes from (move semantics simulation
anyone? :-). My main objection is classifying it as regression. The
issue would deserve a DR if we did not already have 391.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (16 preceding siblings ...)
2006-01-25 3:41 ` gdr at cs dot tamu dot edu
@ 2006-01-25 6:46 ` mmitchel at gcc dot gnu dot org
2006-01-25 15:51 ` gdr at cs dot tamu dot edu
` (14 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-25 6:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #17 from mmitchel at gcc dot gnu dot org 2006-01-25 06:46 -------
This is certainly not a P1 for 4.1. If it's a bug (it probably is, but I still
want to think about it more), it's a minor one, in the grand scheme of things.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (17 preceding siblings ...)
2006-01-25 6:46 ` mmitchel at gcc dot gnu dot org
@ 2006-01-25 15:51 ` gdr at cs dot tamu dot edu
2006-02-24 0:30 ` mmitchel at gcc dot gnu dot org
` (13 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: gdr at cs dot tamu dot edu @ 2006-01-25 15:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #18 from gdr at cs dot tamu dot edu 2006-01-25 15:51 -------
Subject: Re: [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy
constructors
"mmitchel at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| This is certainly not a P1 for 4.1. If it's a bug (it probably is, but I
still
| want to think about it more), it's a minor one, in the grand scheme of
things.
Howard raised the issue on the -core reflector. See c++std-core-11265
when Mike expessed the same opinion as me in previous comments. It is
ill-formed in C++03 (GCC behaviour is correct). However, it is no
longer the same behaviour after the last changes voted in the working
paper.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (18 preceding siblings ...)
2006-01-25 15:51 ` gdr at cs dot tamu dot edu
@ 2006-02-24 0:30 ` mmitchel at gcc dot gnu dot org
2006-04-05 7:10 ` pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-02-24 0:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #19 from mmitchel at gcc dot gnu dot org 2006-02-24 00:26 -------
This issue will not be resolved in GCC 4.1.0; retargeted at GCC 4.1.1.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.3 |4.1.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (19 preceding siblings ...)
2006-02-24 0:30 ` mmitchel at gcc dot gnu dot org
@ 2006-04-05 7:10 ` pinskia at gcc dot gnu dot org
2006-04-24 23:37 ` pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-05 7:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #20 from pinskia at gcc dot gnu dot org 2006-04-05 07:10 -------
*** Bug 12226 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |austern at apple dot com
Bug 25950 depends on bug 12226, which changed state.
Bug 12226 Summary: [3.3 Regression] g++ fails to enforce accessibility requirement for copy constructor
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12226
What |Old Value |New Value
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (20 preceding siblings ...)
2006-04-05 7:10 ` pinskia at gcc dot gnu dot org
@ 2006-04-24 23:37 ` pinskia at gcc dot gnu dot org
2006-05-25 2:37 ` mmitchel at gcc dot gnu dot org
` (10 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-24 23:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #21 from pinskia at gcc dot gnu dot org 2006-04-24 23:37 -------
*** Bug 27295 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ram dot misc at gmail dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (21 preceding siblings ...)
2006-04-24 23:37 ` pinskia at gcc dot gnu dot org
@ 2006-05-25 2:37 ` mmitchel at gcc dot gnu dot org
2006-07-12 23:11 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-05-25 2:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #22 from mmitchel at gcc dot gnu dot org 2006-05-25 02:33 -------
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.1.1 |4.1.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (22 preceding siblings ...)
2006-05-25 2:37 ` mmitchel at gcc dot gnu dot org
@ 2006-07-12 23:11 ` pinskia at gcc dot gnu dot org
2006-08-25 17:41 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-12 23:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #23 from pinskia at gcc dot gnu dot org 2006-07-12 23:11 -------
*** Bug 28365 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kk at microfocus dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (23 preceding siblings ...)
2006-07-12 23:11 ` pinskia at gcc dot gnu dot org
@ 2006-08-25 17:41 ` pinskia at gcc dot gnu dot org
2007-02-14 9:09 ` mmitchel at gcc dot gnu dot org
` (7 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-25 17:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #24 from pinskia at gcc dot gnu dot org 2006-08-25 17:41 -------
*** Bug 28846 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |charles at vmware dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [3.4/4.0/4.1] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (24 preceding siblings ...)
2006-08-25 17:41 ` pinskia at gcc dot gnu dot org
@ 2007-02-14 9:09 ` mmitchel at gcc dot gnu dot org
2007-02-25 16:50 ` [Bug c++/25950] " pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14 9:09 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.1.2 |4.1.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (25 preceding siblings ...)
2007-02-14 9:09 ` mmitchel at gcc dot gnu dot org
@ 2007-02-25 16:50 ` pinskia at gcc dot gnu dot org
2007-03-12 22:00 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-25 16:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #25 from pinskia at gcc dot gnu dot org 2007-02-25 16:49 -------
*** Bug 30959 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sl at datamyway dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (26 preceding siblings ...)
2007-02-25 16:50 ` [Bug c++/25950] " pinskia at gcc dot gnu dot org
@ 2007-03-12 22:00 ` pinskia at gcc dot gnu dot org
2007-10-22 19:14 ` jason at gcc dot gnu dot org
` (4 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-12 22:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #26 from pinskia at gcc dot gnu dot org 2007-03-12 21:59 -------
*** Bug 31156 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (27 preceding siblings ...)
2007-03-12 22:00 ` pinskia at gcc dot gnu dot org
@ 2007-10-22 19:14 ` jason at gcc dot gnu dot org
2007-10-24 3:46 ` jason at gcc dot gnu dot org
` (3 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-10-22 19:14 UTC (permalink / raw)
To: gcc-bugs
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jason at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2006-01-25 03:20:53 |2007-10-22 19:14:21
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (28 preceding siblings ...)
2007-10-22 19:14 ` jason at gcc dot gnu dot org
@ 2007-10-24 3:46 ` jason at gcc dot gnu dot org
2007-11-03 13:40 ` jason at gcc dot gnu dot org
` (2 subsequent siblings)
32 siblings, 0 replies; 34+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-10-24 3:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #27 from jason at gcc dot gnu dot org 2007-10-24 03:45 -------
Subject: Bug 25950
Author: jason
Date: Wed Oct 24 03:45:37 2007
New Revision: 129596
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129596
Log:
PR c++/25950 (DR 391)
* call.c (struct conversion): Remove check_copy_constructor_p.
(reference_binding): Always bind a reference directly to a
compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
temporary creation.
(check_constructor_callable): Remove.
(convert_like_real): Don't call it.
(initialize_reference): Don't call check_constructor_callable.
(standard_conversion): Check LOOKUP_NO_CONVERSION instead of
LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base
conversions if LOOKUP_NO_TEMP_BIND.
(implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
(build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
second conversion.
* cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
Added:
trunk/gcc/testsuite/g++.dg/overload/reftemp1.C
trunk/gcc/testsuite/g++.dg/overload/reftemp2.C
Removed:
trunk/gcc/testsuite/g++.dg/init/copy7.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/cp-tree.h
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (29 preceding siblings ...)
2007-10-24 3:46 ` jason at gcc dot gnu dot org
@ 2007-11-03 13:40 ` jason at gcc dot gnu dot org
2008-07-04 19:32 ` jsm28 at gcc dot gnu dot org
2008-07-31 7:04 ` pinskia at gcc dot gnu dot org
32 siblings, 0 replies; 34+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-11-03 13:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #28 from jason at gcc dot gnu dot org 2007-11-03 13:40 -------
Fixed for 4.3.0.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work|3.3.3 3.2.3 2.95.3 3.0.4 |3.3.3 3.2.3 2.95.3 3.0.4
| |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (30 preceding siblings ...)
2007-11-03 13:40 ` jason at gcc dot gnu dot org
@ 2008-07-04 19:32 ` jsm28 at gcc dot gnu dot org
2008-07-31 7:04 ` pinskia at gcc dot gnu dot org
32 siblings, 0 replies; 34+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 19:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #29 from jsm28 at gcc dot gnu dot org 2008-07-04 19:32 -------
Fixed in 4.3, no longer marked a regression; closing.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|4.1.3 |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread
* [Bug c++/25950] [DR 391] Reference binding and explicit copy constructors
2006-01-24 22:24 [Bug c++/25950] New: Reference binding and explicit copy constructors hhinnant at apple dot com
` (31 preceding siblings ...)
2008-07-04 19:32 ` jsm28 at gcc dot gnu dot org
@ 2008-07-31 7:04 ` pinskia at gcc dot gnu dot org
32 siblings, 0 replies; 34+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-07-31 7:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #30 from pinskia at gcc dot gnu dot org 2008-07-31 07:03 -------
*** Bug 36490 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dervih at interia dot pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25950
^ permalink raw reply [flat|nested] 34+ messages in thread