[invariant] ignore warning 'cast-qual' locally