What is the role of hydrochloric acid in a copper electroplating bath?
As already mentioned by @GM it indeed is used to take out $\ce{Cu^{2+}}$, but it is also used to take out $\ce{Cu+}$.

I know this because I once used a mixture of $\ce{HCl}$ and $\ce{H2O2}$ to etch copper boards, in that process both $\ce{Cu^{2+}}$ and $\ce{Cu+}$ were dissolved by the formation of $\ce{CuCl2}$ and $\ce{CuCl}$ with $\ce{Cl-}$ from $\ce{HCl}$.