A search for doubly charged Higgs bosons decaying to pairs of electrons and/or muons is presented. The search is performed using a data sample corresponding to an integrated luminosity of 4.7 fb−1of pp collisions at √s = 7 TeV collected by the ATLAS detector at the LHC. Pairs of prompt, isolated, high-pT leptons with the same electric charge (e±e±, e±μ±, μ±μ±) are selected, and their invariant mass distribution is searched for a narrow resonance. No significant excess over Standard Model background expectations is observed, and limits are placed on the cross section times branching ratio for pair production of doubly charged Higgs bosons. The masses of doubly charged Higgs bosons are constrained depending on the branching ratio into these leptonic final states. Assuming pair production, coupling to left-handed fermions, and a branching ratio of 100% for each final state, masses below 409 GeV, 375 GeV, and 398 GeV are excluded for e±e±, e±μ±, and μ±μ±, respectively.