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++/57588] [C++11] static constexpr in class fails to link


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

Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richard-gccbugzilla@metafoo
                   |                            |.co.uk

--- Comment #7 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
(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).

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