Const functions sometimes don't do overflow checks in release mode #74823
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code in release mode:
I expected to see this happen:
error: this arithmetic operation will overflow
Instead, code successfully compiled.
If I replace
arg
with1
in function than compilation failing with an overflow error.The text was updated successfully, but these errors were encountered: