The legality of this declaration depends on storage duration of the variable
ptr. If this variable has static storage duration, then the language standard requires that the initializer be a
constant expression. As the compiler rightly says, this is not a legal
constant expression.
This expression could be evaluated at compile time, but that would be extending the language beyond the standard. In practice, it would require a more complex format for object files emitted by the compiler and a more intelligent linker capable of complex address arithmetics. That would be too much complexity just for one questionable feature.