https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125928
Drea Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
> const unsigned long long div2 = 5;
> res = static_cast<double>(num) / div2;
In this case div2 is known to be 5 as it is a const integer expression. So it
can be use exactly as 5 would be there.
In the `/div1` case, the value is not known to the front-end (directly).