One Who Dies On a Major Sin Other Than Shirk

We say he is under the Will of Allah. If Allah Wills, He Will Punish and if He Wills, He Will forgive. And the person is still Muslim if he dies on any sin except shirk.