public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49267] New: Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&"
@ 2011-06-02 18:15 schaub.johannes at googlemail dot com
2011-09-04 23:50 ` [Bug c++/49267] " jason at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: schaub.johannes at googlemail dot com @ 2011-06-02 18:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49267
Summary: Ambiguity with conversion functions "T&" and "T&&",
initializing a "T&&"
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: schaub.johannes@googlemail.com
This is ambiguous with GCC, but probably should select the "T&":
struct X {
operator int&();
operator int&&();
};
int&&x = X();
GCC says:
main1.cpp:7:16: error: conversion from ‘X’ to ‘int’ is ambiguous
main1.cpp:7:16: note: candidates are:
main1.cpp:4:7: note: X::operator int&&()
main1.cpp:3:7: note: X::operator int&()
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/49267] Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&"
2011-06-02 18:15 [Bug c++/49267] New: Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&" schaub.johannes at googlemail dot com
@ 2011-09-04 23:50 ` jason at gcc dot gnu.org
2011-09-05 4:35 ` jason at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-04 23:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49267
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011-09-04
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
Target Milestone|--- |4.7.0
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/49267] Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&"
2011-06-02 18:15 [Bug c++/49267] New: Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&" schaub.johannes at googlemail dot com
2011-09-04 23:50 ` [Bug c++/49267] " jason at gcc dot gnu.org
@ 2011-09-05 4:35 ` jason at gcc dot gnu.org
2011-09-05 4:36 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-05 4:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49267
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-05 04:34:01 UTC ---
Author: jason
Date: Mon Sep 5 04:33:57 2011
New Revision: 178521
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178521
Log:
PR c++/49267
* call.c (reference_binding): Don't set is_lvalue for an rvalue
reference rfrom.
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/49267] Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&"
2011-06-02 18:15 [Bug c++/49267] New: Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&" schaub.johannes at googlemail dot com
2011-09-04 23:50 ` [Bug c++/49267] " jason at gcc dot gnu.org
2011-09-05 4:35 ` jason at gcc dot gnu.org
@ 2011-09-05 4:36 ` jason at gcc dot gnu.org
2011-09-05 15:44 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-05 4:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49267
--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-05 04:33:53 UTC ---
Author: jason
Date: Mon Sep 5 04:33:48 2011
New Revision: 178520
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178520
Log:
PR c++/49267
PR c++/49458
DR 1328
* call.c (reference_binding): Set rvaluedness_matches_p properly
for reference to function conversion ops.
(compare_ics): Adjust.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/rv-conv1.C
trunk/gcc/testsuite/g++.dg/cpp0x/rv-func3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/49267] Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&"
2011-06-02 18:15 [Bug c++/49267] New: Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&" schaub.johannes at googlemail dot com
` (2 preceding siblings ...)
2011-09-05 4:36 ` jason at gcc dot gnu.org
@ 2011-09-05 15:44 ` jason at gcc dot gnu.org
2011-09-05 15:46 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-05 15:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49267
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-05 15:44:06 UTC ---
Author: jason
Date: Mon Sep 5 15:43:58 2011
New Revision: 178552
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178552
Log:
PR c++/49267
* call.c (compare_ics): rvaluedness_matches_p can differ
based on the source type, not just target.
Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/rv-conv1.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/call.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/49267] Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&"
2011-06-02 18:15 [Bug c++/49267] New: Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&" schaub.johannes at googlemail dot com
` (3 preceding siblings ...)
2011-09-05 15:44 ` jason at gcc dot gnu.org
@ 2011-09-05 15:46 ` jason at gcc dot gnu.org
2011-09-17 22:38 ` jason at gcc dot gnu.org
2011-09-17 23:54 ` jason at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-05 15:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49267
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|4.7.0 |4.6.2
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-05 15:45:32 UTC ---
Fixed for 4.6.2.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/49267] Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&"
2011-06-02 18:15 [Bug c++/49267] New: Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&" schaub.johannes at googlemail dot com
` (4 preceding siblings ...)
2011-09-05 15:46 ` jason at gcc dot gnu.org
@ 2011-09-17 22:38 ` jason at gcc dot gnu.org
2011-09-17 23:54 ` jason at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-17 22:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49267
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.6.2 |4.7.0
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-17 22:37:08 UTC ---
The fix in 4.6.2 caused bug 50442, so I've reverted it; still fixed for 4.7.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/49267] Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&"
2011-06-02 18:15 [Bug c++/49267] New: Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&" schaub.johannes at googlemail dot com
` (5 preceding siblings ...)
2011-09-17 22:38 ` jason at gcc dot gnu.org
@ 2011-09-17 23:54 ` jason at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-17 23:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49267
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-17 22:35:15 UTC ---
Author: jason
Date: Sat Sep 17 22:35:10 2011
New Revision: 178932
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178932
Log:
PR c++/50442
Revert:
PR c++/49267
* call.c (compare_ics): rvaluedness_matches_p can differ
based on the source type, not just target.
Removed:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/rv-conv1.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/call.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-09-17 22:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-02 18:15 [Bug c++/49267] New: Ambiguity with conversion functions "T&" and "T&&", initializing a "T&&" schaub.johannes at googlemail dot com
2011-09-04 23:50 ` [Bug c++/49267] " jason at gcc dot gnu.org
2011-09-05 4:35 ` jason at gcc dot gnu.org
2011-09-05 4:36 ` jason at gcc dot gnu.org
2011-09-05 15:44 ` jason at gcc dot gnu.org
2011-09-05 15:46 ` jason at gcc dot gnu.org
2011-09-17 22:38 ` jason at gcc dot gnu.org
2011-09-17 23:54 ` jason at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).