On adding $\ce{BaCl2}$ solution to $\ce{ SO4^{2-}}$ salt aqueous solution $\ce{ BaSO4}$ is formed as a white precipitate, which confirms the presence of the anion.
While doing the test in my school laboratory, we were given a list of procedures to follow; for $\ce{ SO4^{2-}}$ it read:
'Experiment: Aqueous solution of sample + dilute $\ce{ HCl}$ + $\ce{ BaCl2}$ solution
Observation: white ppt'
Why do we need to add $\ce{ HCl}$?