graves, but now visit them,” are addressed to men, not women. The wording is masculine: it either applies exclusively to males or includes others by extension.
If it applies exclusively to men, women are not mentioned. If it includes others, then the wording is general, whereas his statement:
“Allah has cursed women who visit graves”
applies specifically to women, not men. Do you not see that he says:
“Allah has cursed women who visit graves and those who establish places of worship over them and place lamps upon them”?
Allah has cursed those who establish places of worship over graves and place lamps upon them, whether they are male or female. As for those who visit graves, however, he cursed only the women who visit them, not the men. Since this statement is specific, and it is not known to have preceded the permission, it takes precedence over the general wording according to the great majority of scholars. The same applies if it is known to have come after that permission.
This is comparable to his statement (peace and blessings be upon him):
“Whoever offers the funeral prayer receives one qīrāt of reward, and whoever follows the funeral procession until the burial receives two qīrāts.”
This wording is general, yet women are not included, because it is established in the Sahīh that he forbade women from following funeral processions.
ʿAbd Allāh ibn ʿUmar narrated:
“We set out with the Messenger of Allah (peace and blessings be upon him)—meaning that we were accompanying a funeral procession. When we had finished, the Messenger of Allah (peace and blessings be upon him) departed, and we departed with him. When we were midway along the road, we saw a woman approaching. As she drew near, we realized that she was Fātimah. The Messenger of Allah (peace and blessings be upon him) said to her, ‘What has brought you out of your house, Fātimah?’ She replied, ‘I came, O Messenger of Allah, to the family of this