The amendment had been brought by former Labour leader Harriet Harman to ensure that all EU citizens living in the UK on 23 June 2016 - the date of the referendum - would have their right to stay protected.