Spouses may inherit from one another as soon as the marriage contract is done, and there is no stipulation that the marriage be consummated
Question

                If a man does the marriage contract with a girl but does not consummate the marriage with her, and one of them dies, does one of them inherit from the other or not? What is the ruling regarding the ‘iddah if the man dies before consummating the marriage? Does she have to observe the ‘iddah or not?
Praise be to Allah.If the marriage contract is done, fulfilling all the necessary conditions, then one of the spouses dies before consummation of the marriage, the marriage contract remains in effect and spouses inherit from one another, because of the general meaning of the verse in which Allah, may He be exalted, says (interpretation of the meaning):
“And for you is half of what your wives leave if they have no child. But if they have a child, for you is one fourth of what they leave, after any bequest they [may have] made or debt. And for the wives is one fourth if you leave no child. But if you leave a child, then for them is an eighth of what you leave, after any bequest you [may have] made or debt”
[an-Nisaa’ 4:12].
The verse is general in meaning and is applicable to the woman whose husband dies before or after consummation of the marriage. If the marriage contract has been completed and one of the spouses dies before consummation of the marriage, then the marriage remains in effect and the inheritance of one spouse from the other is dictated by sharia because of the general meaning of this verse.
Likewise with regard to the ‘iddah, the wife is obliged to observe the ‘iddah of one whose husband has died even if her husband who did the marriage contract with her dies before consummation of the marriage. In that case she must observe ‘iddah like any other widow, because of the general meaning of the verse in which Allah, may He be exalted, says (interpretation of the meaning):
“And those who are taken in death among you and leave wives behind - they, [the wives, shall] wait four months and ten [days]”
[al-Baqarah 2:234].
This includes both the one whose husband dies before consummation of the marriage and the one whose husband dies after consummation. (In either case) the wife is entitled to inheritance, as mentioned above.
Al-Muntaqa min Fataawa ash-Shaykh Saalih al-Fawzaan (3/135).
Abu Daawood (2114) narrated that Ibn Mas‘ood (may Allah be pleased with him) was asked about a woman whose husband died before consummation of the marriage, and he had not specified a dowry for her. He said: She is entitled to the dowry in full, like that of her peers; she must observe ‘iddah and she is entitled to inheritance. Ma‘qil ibn Sinaan (may Allah be pleased with him) said: I heard the Messenger of Allah (blessings and peace of Allah be upon him) issue the same verdict as you concerning Birwa‘ bint Waashiq, one of our women.
Classed as saheeh by al-Albaani in Irwaa’ al-Ghaleel (1939).