When you don't rip #841 out of context with the whole discussion is says nothing of the sort.
Unfortunately, that's clearly not the case. The context simply perpetuates and expounds upon the same unbiblical teaching found in #841.
* 839 "Those who have not yet received the Gospel are related to the People of God in various ways."[325] The relationship of the Church with the Jewish People. When she delves into her own mystery, the Church, the People of God in the New Covenant, discovers her link with the Jewish People,[326] "the first to hear the Word of God."[327] The Jewish faith, unlike other non-Christian religions, is already a response to God's revelation in the Old Covenant. To the Jews "belong the sonship, the glory, the covenants, the giving of the law, the worship, and the promises; to them belong the patriarchs, and of their race, according to the flesh, is the Christ",[328] "for the gifts and the call of God are irrevocable."[329]
* 840 And when one considers the future, God's People of the Old Covenant and the new People of God tend towards similar goals: expectation of the coming (or the return) of the Messiah. But one awaits the return of the Messiah who died and rose from the dead and is recognized as Lord and Son of God; the other awaits the coming of a Messiah, whose features remain hidden till the end of time; and the latter waiting is accompanied by the drama of not knowing or of misunderstanding Christ Jesus.
* 841 The Church's relationship with the Muslims. "The plan of salvation also includes those who acknowledge the Creator, in the first place amongst whom are the Muslims; these profess to hold the faith of Abraham, and together with us they adore the one, merciful God, mankind's judge on the last day."[330]
* 842 The Church's bond with non-Christian religions is in the first place the common origin and end of the human race: All nations form but one community. This is so because all stem from the one stock which God created to people the entire earth, and also because all share a common destiny, namely God. His providence, evident goodness, and saving designs extend to all against the day when the elect are gathered together in the holy city. . .[331]
* 843 "The Catholic Church recognizes in other religions that search, among shadows and images, for the God who is unknown yet near since he gives life and breath and all things and wants all men to be saved. Thus, the Church considers all goodness and truth found in these religions as 'a preparation for the Gospel and given by him who enlightens all men that they may at length have life.'
In other words Muslims can be saved if they have had zero exposure to the Gospel, and therefore have not had the chance to accept or reject it. #841 is not saying that Muslims are saved regardless of their exposure to and rejection of the Gospel.
God has already shown them what may be known of Him. His invisible attributes, eternal power, and Godhead are clearly seen, so that they are without excuse. Although they knew God, they did not glorify Him as God, but instead suppressed the truth in unrighteousness, glorifying a false god, Allah, and their foolish hearts were darkened (Romans 1:18-21).
18 For the wrath of God is revealed from heaven against all ungodliness and unrighteousness of men, who suppress the truth in unrighteousness,
19 because what may be known of God is manifest in them, for God has shown it to them.
20 For since the creation of the world His invisible attributes are clearly seen, being understood by the things that are made, even His eternal power and Godhead, so that they are without excuse,
21 because, although they knew God, they did not glorify Him as God, nor were thankful, but became futile in their thoughts, and their foolish hearts were darkened. (Romans 1:18-21)
Therefore, all Muslims have denied God and rejected Christ (just as all men do in their sin). The Bible does not teach this Catholic notion that sinful man can somehow be in an innocent state of ignorant neutrality. Instead, it has this to say about the unbelieving (Muslims, who are also liars and idolaters):
8 But the cowardly, unbelieving, abominable, murderers, sexually immoral, sorcerers, idolaters, and all liars shall have their part in the lake which burns with fire and brimstone, which is the second death." (Revelation 21:8)
Contrary to what the false teachers in the Catholic Church would have you believe, all Muslims have their part in the lake which burns with fire and brimstone, which is the second death (Revelation 21:8).
Been discussed ad nauseam in other threads.
There's no need to discuss it. I was just pointing out a few among the multitudes of the Catholic Church's extra-biblical doctrines.