The Shulchan Aruch · Orach Chayim
אורח חיים קצ״וOrach Chayim 196
Siman 196 of 697 in Orach Chayim — 4 se'ifim
הלכות סעודהLaws of the Meal· siman 196
Se’if 1א׳
אָכַל דְּבַר אִסוּר, אַף עַל פִּי שֶׁאֵינוֹ אָסוּר אֶלָּא מִדְּרַבָּנָן, אֵין מְזַמְּנִין עָלָיו וְאֵין מְבָרְכִין עָלָיו לֹא בִּתְחִלָּה וְלֹא בַּסוֹף.
If one ate a forbidden item (even it is forbidden only by the sages), one cannot make a zimun on it or say a blessing on it, neither before or after it.
Se’if 2ב׳
אִם אָכַל דְּבַר אִסוּר בִּמְקוֹם סַכָּנָה, מְבָרְכִים עָלָיו. וְעַיֵּן לְקַמָּן סי' ר"ד.
If one ate a forbidden item in a place of danger, he is allowed to bless on it.
Se’if 3ג׳
שְׁלֹשָׁה שֶׁאָכְלוּ כְּאֶחָד, וְאֶחָד נִזְהָר בְּפַּת עוֹבֵד כּוֹכָבִים וְאֶחָד אֵינוֹ נִזְהָר, אוֹ אֶחָד מֵהֶן כֹּהֵן וְאוֹכֵל חַלּוֹת, אַף עַל פִּי שֶׁאוֹתוֹ שֶׁנִּזְהָר אֵינוֹ יָכוֹל לֶאֱכֹל עִם אוֹתוֹ שֶׁאֵינוֹ נִזְהָר, וְלֹא יִשְׂרָאֵל עִם הַכֹּהֵן, כֵּיוָן שֶׁאוֹתוֹ שֶׁאֵינוֹ נִזְהָר יָכוֹל לֶאֱכֹל עִם הַנִּזְהָר וְכֹהֵן עִם הַיִּשְׂרָאֵל, מִצְטָרְפִין; אֲבָל אִם הָיוּ כֹּהֲנִים וְזָר אוֹכְלִים כְּאֶחָד, וְהַכֹּהֲנִים אוֹכְלִים חַלָּה וְנִזְהָרִים מִפַּת שֶׁל עוֹבֵד כּוֹכָבִים וְהַזָּר אוֹכֵל פַּת שֶׁל עוֹבֵד כּוֹכָבִים, אֵינָם מִצְטָרְפִין. וְהוּא הַדִּין לִשְׁלֹשָׁה שֶׁמֻּדָּרִים זֶה מִזֶּה שֶׁאֵינָם מִצְטָרְפִין לְזִמּוּן. הַגָּה: וְדַוְקָא כְּשֶׁכָּל אֶחָד אוֹכֵל מִכִּכָּרוֹ, אֲבָל אִם אוֹכְלִים מִכִּכַּר בַּעַל הַבַּיִת, מִצְטָרְפִין דְּהָא אוֹכְלִים מִכִּכָּר אֶחָד. (א"ז)
Three ate together: one of them is careful not to eat gentile made bread and the other is not careful [ie he eats gentile made bread], or one of them is a Kohane and he eats challah. Even though the one who is careful [not to eat gentile made bread] can not eat [gentile made bread] with the one who is not careful, and [even though] a Yisrael cannot [eat challah] with the Kohane, since the one who is not careful [ie he eats gentile made bread] can eat [Jewish made bread] with the one who is careful, and [since] a Kohane is permitted to eat bread with a Yisrael, [when these eat together] they combine [to form a zimun]. But when there are Kohanim and a Non-Kohen eating together and the Kohanim are eating Challah and they are careful not to eat the gentile made bread, while the Yisrael [ie Non-Kohen] is eating gentile made bread, the Kohanim and Non-Kohen may not say zimun together. The same law applies when three take vows [not to benefit] from each other, i.e. they may not say zimun together.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0