issue #23894: use priv function after it's declared