This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/34023] Wrong using of user-defined conversion operator for converting rvalue to reference on constant.



------- Comment #3 from sergey dot gcc at comrades dot id dot au  2007-11-09 01:14 -------
// Workaround:
class a
{
public:
        template<class T>
        operator T &() const
                throw(typename ::boost::disable_if<
                        ::boost::is_same<T, ref_t const> >::type *)
        {
                static int f;
                return f;
        }
};

int main()
{
        a const &aa = a(); // line # 27
        int &i = aa;
}


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]