issue #2050: use static_cast