The cute code below triggers an ICE with the XE 2017 Beta compiler.
We would prefer that you use Intel Premier Support for all beta issues. I'll file this one for you.
This also fails in 16.0. Issue number is DPD200409878.
Fixed for a future release.
I got a response on one ips filing on the beta. I'm not holding my breath.
For more complete information about compiler optimizations, see our Optimization Notice.