This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37043] fails to find operator match when constructing object on the fly
- From: "scott at stg dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Aug 2008 13:31:12 -0000
- Subject: [Bug c++/37043] fails to find operator match when constructing object on the fly
- References: <bug-37043-16567@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from scott at stg dot net 2008-08-07 13:31 -------
Okay, so if I change:
FooBar& operator>> (const char *s,FooBar& dest)
to
FooBar operator>> (const char *s,FooBar dest)
It now compiles on both msvc and g++, but required functionality (operation
affecting existing object, not making new copy of it) is lost.
Is there some reason that using a reference to rvalue in operator>> is
disallowed in gcc and not msvc? If so, why doesn't it fail in the A>>object;
instance where the object has already been instantiated separately?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37043