Please consider the attached candidate bugfix patch authored with Codex. It introduces a new diagnostic message: E_CONSTEXPR_INTEGER: "initialiser for constexpr integer object is not an integer constant expression".
The neighbouring TODO about loss of range or precision in constExprValue appears to be more closely related to [bugs:#4191] than this bug.
"warning 158: overflow in implicit constant conversion" is already emitted for integer constant expressions that exceed the range of the constexpr being initialised. Missing diagnostics for constexpr initialisers for bool type were reported separately as [bugs:#4230].

 

Related

Bugs: #4191
Bugs: #4230


Last edit: Maarten Brock 3 days ago