Court affirms illegal immigrants can't have guns