The Messenger of Allah ﷺ said, "Whoever swears by a religion other than Islam is as he has said. The son of Adam is not bound by a vow concerning what he does not possess. Whoever kills himself with something in this world will be tormented with it on the Day of Resurrection. Whoever curses a believer, it is as if he has killed him, and whoever accuses a believer of disbelief, it is as if he has killed him."
أن رسول الله ﷺ قال: من حلف على ملة غير الإسلام فهو كما قال. وليس على ابن آدم نذر فيما لا يملك، ومن قتل نفسه بشيء في الدنيا عذب به يوم القيامة، ومن لعن مؤمنا فهو كقتله، ومن قذف مؤمنا بكفر- فهو كقتله.
Bukhari narrated it in the Book of Manners (6047) and Muslim in the Book of Faith (176:110), both from the hadith of Yahya bin Abu Kathir, from Abu Qilaba, that Thabit bin Qays told him, and he mentioned it.Tirmidhi said (1543), "The people of knowledge have differed regarding this, when a man swears by a religion other than Islam, saying, 'I am a Jew' or 'a Christian if I do such and such,' and then does that thing. Some of them said, he has committed a grave sin, but no atonement is due on him, and this is the view of the people of Madinah, and it is the view of Malik bin Anas, and Abu Ubayd adopted this view as well. Some of the people of knowledge among the companions of the Prophet ﷺ and the successors and others said that atonement is due on him in that case, and this is the view of Sufyan, Ahmad, and Ishaq."