public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50442] New: Constructing T from implicit conversion to T& ambiguous in C++0x mode, not C++98
@ 2011-09-17  9:12 zackw at panix dot com
  2011-09-17  9:31 ` [Bug c++/50442] " mh+gcc at glandium dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zackw at panix dot com @ 2011-09-17  9:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50442

             Bug #: 50442
           Summary: Constructing T from implicit conversion to T&
                    ambiguous in C++0x mode, not C++98
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zackw@panix.com


This test case ...

    template <typename T> struct MoveRef { operator T& () {} };
    template <typename T> MoveRef <T> Move(T&) {}
    struct Thing {};
    Thing foo(const Thing* p) { return Thing(Move(*p)); }

... generates these diagnostics from g++ 4.6.1 in c++0x/gnu++0x mode, but not
in c++98/gnu++98 mode:

t.cc: In function ‘Thing foo(const Thing*)’:
t.cc:4:50: error: call of overloaded ‘Thing(MoveRef<const Thing>)’ is ambiguous
t.cc:4:50: note: candidates are:
t.cc:3:8: note: constexpr Thing::Thing(const Thing&)
t.cc:3:8: note: constexpr Thing::Thing(Thing&&)

This is a regression from g++ 4.5.x and earlier.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-20 19:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-17  9:12 [Bug c++/50442] New: Constructing T from implicit conversion to T& ambiguous in C++0x mode, not C++98 zackw at panix dot com
2011-09-17  9:31 ` [Bug c++/50442] " mh+gcc at glandium dot org
2011-09-17 10:13 ` redi at gcc dot gnu.org
2011-09-17 10:55 ` redi at gcc dot gnu.org
2011-09-17 22:37 ` [Bug c++/50442] [4.6 regression] " jason at gcc dot gnu.org
2011-09-17 22:38 ` jason at gcc dot gnu.org
2011-09-17 23:55 ` jason at gcc dot gnu.org
2011-09-20 21:01 ` 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).