Fix compilation with the Oracle / Sun compiler (#15318)

One piece of code has some ambiguous type deduction that seems to
resolve correctly for most compilers but not for the Oracle compiler.
Make it more explicit.
Merge topic 'backport-suncc-fixes'

107dcac3 Fix compilation with the Oracle / Sun compiler (#15318)