http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57588
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
||.co.uk
--- Comment #7 from Richard Smith ---
(In reply to Jonathan Wakely from comment #6)
> (In reply to Daniel Krügler from comment #4)
> > I don't think that this correct here (In C++11 the rules became relaxed).
>
> It was post-C++11, but as a DR we should implement it, and I see you're
> right, the initialization of int_ uses the lvalue-to-rvalue conversion
> immediately so it isn't odr-used.
The mem-initializer in question is "int_(kLiteral)", or after performing
overload resolution, "int_(kLiteral.operator int())". This is an odr-use of
kLiteral, therefore a definition is required. There is no lvalue-to-rvalue
conversion here; 'Literal::operator int' returns an rvalue (and in any case,
kLiteral is not in the set of potential results of the expression).