[Bug c++/31419] template user defined conversion operator instantiated for conversion to self

james dot kanze at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Apr 1 14:42:00 GMT 2007



------- Comment #2 from james dot kanze at gmail dot com  2007-04-01 15:42 -------
Subject: Re:  template user defined conversion operator instantiated for
conversion to self

On 1 Apr 2007 14:38:52 -0000, fang at csl dot cornell dot edu
<gcc-bugzilla@gcc.gnu.org> wrote:

> ------- Comment #1 from fang at csl dot cornell dot edu  2007-04-01 15:38 -------
> Aside, it looks to me as if operator () returns a reference (const) to a
> temporary, which is undefined, no?

There is no operator() in the code.  And there is no undefined
behavior is the reference is not used.  But that's not the
point.  What the user defined conversion operator does is
irrelevant, since it should never even be instantiated.

(This is not the actual code in my application, of course.  I've
simplified it to the maximum.)


-- 


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



More information about the Gcc-bugs mailing list