[Bug c++/57588] [C++11] static constexpr in class fails to link

2015-03-25 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57588

Paolo Carlini  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #8 from Paolo Carlini  ---
Thus, if I understand correctly the discussion (otherwise, please, reopen!)
modulo access control issues in the testcase, we correctly fail at linktime.


[Bug c++/57588] [C++11] static constexpr in class fails to link

2013-06-30 Thread richard-gccbugzilla at metafoo dot co.uk
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).