The spectral density of random graphs with topological constraints is analysed using the replica method. We consider graph ensembles featuring generalised degree-degree correlations, as well as those with a community structure. In each case an exact solution is found for the spectral density in the form of consistency equations depending on the statistical properties of the graph ensemble in question. We highlight the effect of these topological constraints on the resulting spectral density.