Heterocyclic compounds containing 1,2-diazole or hydrogenated 1,2-diazole rings condensed with carbocyclic rings or ring-systems