RFR: 8314258: Add integer_cast for checking conversions don't change the value [v5]
Andrew Haley
aph at openjdk.org
Wed Feb 18 09:29:45 UTC 2026
On Wed, 18 Feb 2026 01:30:17 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> I have the requisite 2 reviews, but wondering if @theRealAph is going to have anything more to say? Not super urgent, just wondering if I should hold off.
I think it's OK now. I'm not _totally_ happy with the name, which IMO doesn't suggest what it really does, which is check that src is within the range of dest, but then `checked_cast` doesn't suggest what it really does either.
I'm not keen on the naked boolean argument to `integer_cast`. Does this look better with an enum type rather than a boolean?
`a = integer_cast<int, tautology_ok>(b);`
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29582#issuecomment-3919651580
More information about the hotspot-dev
mailing list