Terniaries are broken under MSVC, they never did resolve how to resolve the type of an obvious conversion like this one. Even casting the const to an apr_port_t doesn't solve it.