This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30925] c++ frontend error: ?-operator parameter binding
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Feb 2007 23:37:00 -0000
- Subject: [Bug c++/30925] c++ frontend error: ?-operator parameter binding
- References: <bug-30925-14144@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-02-22 23:37 -------
Hmm, ?: is a lvalue in C++. Since m_a is still an lvalue (a non modifiable one
though) we try to use "operator short&" so we get the same type, const short&,
on both sides of the ":" as short& is a closer match to const short& as for
short you have to bind a rvalue to a lvalue which is a longer way around. So
is not a bug in GCC.
If you want this to work, change "operator short" to "operator const short&"
and it will just work.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30925