* [Bug c++/32658] Supposedly illegal conversion compiles without errors
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
@ 2007-07-06 21:44 ` aribrei at arcor dot de
2007-07-07 0:00 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: aribrei at arcor dot de @ 2007-07-06 21:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from aribrei at arcor dot de 2007-07-06 21:44 -------
Created an attachment (id=13857)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13857&action=view)
File that compiles unexpectedly, without warnings (no #includes)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32658
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32658] Supposedly illegal conversion compiles without errors
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
2007-07-06 21:44 ` [Bug c++/32658] " aribrei at arcor dot de
@ 2007-07-07 0:00 ` pinskia at gcc dot gnu dot org
2007-07-07 1:46 ` aribrei at arcor dot de
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-07 0:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-07-07 00:00 -------
And why do you think it is not?
I don't have access to my copy of the standard but I think this is valid thing
to do.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32658
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32658] Supposedly illegal conversion compiles without errors
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
2007-07-06 21:44 ` [Bug c++/32658] " aribrei at arcor dot de
2007-07-07 0:00 ` pinskia at gcc dot gnu dot org
@ 2007-07-07 1:46 ` aribrei at arcor dot de
2007-07-09 12:39 ` aribrei at arcor dot de
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: aribrei at arcor dot de @ 2007-07-07 1:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from aribrei at arcor dot de 2007-07-07 01:46 -------
I don't have a copy of the standard at all, unfortunately, but I was referred
to [12.3.2/1 p.6]. If I understood correctly, the problem being that implicit
conversions shall not take place for the class or a base class of the type.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32658
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32658] Supposedly illegal conversion compiles without errors
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
` (2 preceding siblings ...)
2007-07-07 1:46 ` aribrei at arcor dot de
@ 2007-07-09 12:39 ` aribrei at arcor dot de
2007-08-01 19:42 ` nathan at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: aribrei at arcor dot de @ 2007-07-09 12:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from aribrei at arcor dot de 2007-07-09 12:39 -------
I should note that I do NOT want to see this bug fixed. I would prefer to hear
that you won't "fix" it at all. So I can exploit this behavior as there is no
standards-compliant way of achieving the same results.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32658
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32658] Supposedly illegal conversion compiles without errors
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
` (3 preceding siblings ...)
2007-07-09 12:39 ` aribrei at arcor dot de
@ 2007-08-01 19:42 ` nathan at gcc dot gnu dot org
2007-08-02 15:56 ` widman at gimpel dot com
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: nathan at gcc dot gnu dot org @ 2007-08-01 19:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from nathan at gcc dot gnu dot org 2007-08-01 19:42 -------
The standard is unclear about exactly why this is ill-defined. Does the
conversion operator take part in overload resolution (and then be rejected, if
it is selected), or is it never entered into the overload set.
I shall query CWG.
--
nathan at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |nathan at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-08-01 19:42:14
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32658
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32658] Supposedly illegal conversion compiles without errors
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
` (4 preceding siblings ...)
2007-08-01 19:42 ` nathan at gcc dot gnu dot org
@ 2007-08-02 15:56 ` widman at gimpel dot com
2007-08-02 16:35 ` aribrei at arcor dot de
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: widman at gimpel dot com @ 2007-08-02 15:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from widman at gimpel dot com 2007-08-02 15:56 -------
(In reply to comment #4)
> I should note that I do NOT want to see this bug fixed. I would prefer to hear
> that you won't "fix" it at all. So I can exploit this behavior as there is no
> standards-compliant way of achieving the same results.
Is it possible that rvalue references will give you an alternative for the
desired effect? See the relevant papers linked to from here:
http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2291.html
--
widman at gimpel dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |widman at gimpel dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32658
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32658] Supposedly illegal conversion compiles without errors
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
` (5 preceding siblings ...)
2007-08-02 15:56 ` widman at gimpel dot com
@ 2007-08-02 16:35 ` aribrei at arcor dot de
2007-08-02 17:07 ` widman at gimpel dot com
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: aribrei at arcor dot de @ 2007-08-02 16:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from aribrei at arcor dot de 2007-08-02 16:34 -------
(In reply to comment #6)
> (In reply to comment #4)
> > I should note that I do NOT want to see this bug fixed. I would prefer to hear
> > that you won't "fix" it at all. So I can exploit this behavior as there is no
> > standards-compliant way of achieving the same results.
>
> Is it possible that rvalue references will give you an alternative for the
> desired effect? See the relevant papers linked to from here:
>
> http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2291.html
>
This would mean that instead of A::A(A &), I wrote A::A(A &&) and passing
temporaries would automatically work?
(Not sure if I correctly understand the r-value reference proposal.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32658
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32658] Supposedly illegal conversion compiles without errors
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
` (6 preceding siblings ...)
2007-08-02 16:35 ` aribrei at arcor dot de
@ 2007-08-02 17:07 ` widman at gimpel dot com
2007-08-02 17:17 ` widman at gimpel dot com
2007-08-02 18:39 ` aribrei at arcor dot de
9 siblings, 0 replies; 11+ messages in thread
From: widman at gimpel dot com @ 2007-08-02 17:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from widman at gimpel dot com 2007-08-02 17:07 -------
(In reply to comment #7)
> (In reply to comment #6)
> > Is it possible that rvalue references will give you an alternative for the
> > desired effect? See the relevant papers linked to from here:
> >
> > http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2291.html
> >
>
> This would mean that instead of A::A(A &), I wrote A::A(A &&) and passing
> temporaries would automatically work?
That's correct. Rvalues would bind directly to the 'A&&' parameter; you could
even have two ctors:
struct A {
A(const A&); // copy ctor
A(A&&); // move ctor
};
...and when you initialize an 'A' with an rvalue, overload resolution will
select the move ctor.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32658
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32658] Supposedly illegal conversion compiles without errors
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
` (7 preceding siblings ...)
2007-08-02 17:07 ` widman at gimpel dot com
@ 2007-08-02 17:17 ` widman at gimpel dot com
2007-08-02 18:39 ` aribrei at arcor dot de
9 siblings, 0 replies; 11+ messages in thread
From: widman at gimpel dot com @ 2007-08-02 17:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from widman at gimpel dot com 2007-08-02 17:17 -------
See also:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29939
So it seems you should be able to play with it now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32658
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32658] Supposedly illegal conversion compiles without errors
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
` (8 preceding siblings ...)
2007-08-02 17:17 ` widman at gimpel dot com
@ 2007-08-02 18:39 ` aribrei at arcor dot de
9 siblings, 0 replies; 11+ messages in thread
From: aribrei at arcor dot de @ 2007-08-02 18:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from aribrei at arcor dot de 2007-08-02 18:39 -------
(In reply to comment #9)
> See also:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29939
>
> So it seems you should be able to play with it now.
>
Unfortunately, I have to support older GCC version (like 4.0 and 4.1) for now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32658
^ permalink raw reply [flat|nested] 11+ messages in thread