Shaykh Muhammad ibn ‘Uthaymeen (may Allaah have mercy on him) said:
There is nothing wrong with saying, “Fulaan al-marhoom (So and so upon whom Allaah has mercy?),” and “May Allaah shower him with His Mercy,” because saying “marhoom (the one on whom Allaah has mercy)” comes under the heading of optimism and hope, not of giving news. If it comes under the heading of optimism and hope, there is nothing wrong with it.
With regard to saying “He has gone to the mercy of Allaah,” this also appears to come under the heading of optimism, not of giving news, because this is one of the matters of the unseen, and we cannot be certain of it.
But we should not say, “He has gone to join the higher ranks.”