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

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).