I believe it is well-defined, since the standard only ascribes undefined behaviour to modifying a const
object. C++11 quotes follow:
[expr.const.cast] 5.2.11 §7
[ Note: Depending on the type of the object, a write operation through the pointer, lvalue or pointer
to data member resulting from a const_cast
that casts away a const-qualifier may produce undefined
behavior (7.1.6.1). —end note ]
[dcl.type.cv] 7.1.6.1 §4
Except that any class member declared mutable
(7.1.1) can be modified, any attempt to modify a const
object during its lifetime (3.8) results in undefined behavior. ...
GetA()
does not actually modify any object, so it doesn't have undefined behaviour.