  We study analytically the intricate phase behavior of cross-linked $AB$
diblock copolymer melts, which can undergo two main phase transitions due to
quenched random constraints: Gelation, i.e., spatially random localization of
polymers forming a system-spanning cluster, is driven by increasing the number
parameter $\mu$ of irreversible, type-selective cross-links between random
pairs of $A$ blocks. Self-assembly into a periodic pattern of $A$/$B$-rich
microdomains (microphase separation) is controlled by the $AB$ incompatibility
$\chi$ inversely proportional to temperature. Our model aims to capture the
system's essential microscopic features, including an ensemble of random
networks that reflects spatial correlations at the instant of cross-linking. We
identify suitable order parameters and derive a free-energy functional in the
spirit of Landau theory that allows us to trace a phase diagram in the plane of
$\mu$ and $\chi$. Selective cross-links promote microphase separation at higher
critical temperatures than in uncross-linked diblock copolymer melts.
Microphase separation in the liquid state facilitates gelation, giving rise to
a novel gel state whose chemical composition density mirrors the periodic $AB$
pattern.
