Fixing the warning for recent g++ versions introduced it for the old one, so work around this inside our workaround. See #17005.