Because the standard says so. Here are some citations:
In that particular cast, the value of the pointer is unchanged. http://eel.is/c++draft/expr.static.cast#13.sentence-4
Since the value is unchanged, it still points to the int object. Therefore, when the indirection operator is used, it yields an lvalue of type `char` that denotes the object the pointer points to. http://eel.is/c++draft/expr.unary.op#1.sentence-1
Now, when an lvalue-to-rvalue conversion is applied to the lvalue (such as during initialization), the result is the value of the object (which has NOT been truncated), and since that value is within the representable range of `char`, the behavior is well defined, and will ALWAYS yield 42.
(If it's outside the representable range of char, the behavior is undefined http://eel.is/c++draft/expr.pre#4)
-------- Original message --------
From: Jake Arkinstall via Std-Proposals <std-proposals@lists.isocpp.org>
Date: 8/21/19 19:24 (GMT-05:00)
To: std-proposals@lists.isocpp.org
Cc: Jake Arkinstall <jake.arkinstall@gmail.com>
Subject: Re: [std-proposals] Allowing access to object representations