Is the casting of infinity (represented by float) to an integer an undefined behavior?
The standard says:
4.10 Floating-integral conversions<
You said
I can't tell whether "truncated value cannot be represented" covers infinity
but it all boils down to
What is the result of truncating infinity.
The C standard (incorporated into C++ via 26.9) answers that quite plainly:
Since truncation of infinity is still infinity, and infinity cannot be represented in int
(I hope there's no question about this part), the behavior is undefined.