Density functional theory of autodetaching states