In the body of a non-static ([class.mfct]) member function, the
keyword this is a prvalue expression whose value is the
address of the object for which the function is called.
The type of this in a member function of a class X is
X*.
If the member function is declared const, the type of
this is constX*,
if the member function is declared volatile, the type of
this is volatileX*, and if the member function
is declared constvolatile, the type of this is
constvolatileX*.
A cv-qualified member function can be called on an
object-expression ([expr.ref]) only if the object-expression is as
cv-qualified or less-cv-qualified than the member function.
The call y.g() is ill-formed because y is const
and s::g() is a non-const member function, that is,
s::g() is less-qualified than the object-expression y.