This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36430] Cannot convert a temporary to a non-const reference even with conversion operator
- From: "gcc-bugzilla at contacts dot eelis dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Aug 2008 11:43:33 -0000
- Subject: [Bug c++/36430] Cannot convert a temporary to a non-const reference even with conversion operator
- References: <bug-36430-16279@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from gcc-bugzilla at contacts dot eelis dot net 2008-08-21 11:43 -------
This report is invalid. By 12.3.2,
"A conversion function is never used to convert a
(possibly cv-qualified) object to the (possibly
cv-qualified) same object type (or a reference to it)."
Comeau warns explicitly about this, saying:
line 2: warning: "Foo::operator Foo &()" will not be
called for implicit or explicit conversions
--
gcc-bugzilla at contacts dot eelis dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gcc-bugzilla at contacts dot
| |eelis dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36430