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