Ibn Abbas (may Allah be pleased with him) reported that the Messenger (peace be upon him) was cupped while he was fasting - Sahih Bukhari (5694). That is, cupping does not break the fast.
We had the honour of speaking to Shaykh Taha Hanafy this time last year about cupping whilst fasting. He reminded us that only those who are anaemic should avoid cupping whilst fasting. In the case of someone who is anaemic, they can wait for the Maghrib adthan, be cupped and then break their fast.
For those who have been cupped whilst fasting, Shaykh Taha suggested that when the time comes to break the fast, the best thing to drink would be a glass of water with a small amount of pure honey and a small amount of cider vinegar. May Allah reward Shaykh Taha and grant him success.
Additional information (added May 2019)
Imam Abu Hanifa, Imam Shafiee, Imam Malik and many other scholars, state that hijama does not break the fast and is permissible. Narrated Ibn `Abbas: The Prophet (peace be upon him) had hijama while he was in the state of lhram, and also while he was observing a fast. (Sahih Bukhari 1938). Anas bin Malik was asked whether they disliked hijama for a fasting person. He replied in the negative and said, “Only if it causes weakness.” (Sahih al-Bukhari 1940).
Imam Ahmed Ibn Hanbal and Imam Awzaee believe hijama invalidates the fast. Narrated Thawban: The Prophet (peace be upon him) said, “A man who did the hijama and a man who had hijama done to him (both) broke their fast.” (Sunan Abi Dawud 2367). Thawban said, “I heard the Prophet (saw) say, ‘The hujjam and the one for whom hijama is done both break their fast.’” (Ibn Majah 1680)
Ibn Hazm said, “No doubt, the hadith of hijama is sahih, however, we find that the hadith of Abu Saeed Khudri (may Allah be pleased with him) that states “the Messenger of Allah, peace be upon him, permitted hijama for the fasting” is also Sahih. Therefore it is necessary to take this (second) hadith because permission comes after prohibition.”
Imam Malik said “Yahya related to me from Malik from Hisham ibn Urwa that his father used have hijama while he was fasting and he would not then break his fast. Hisham added, “I only ever saw him having hijama when he was fasting.”
Imam Malik also said, “Hijama is only disapproved of for someone who is fasting out of fear that he will become weak and if it were not for that, it would not be disapproved of. I do not think that a man who has hijama in Ramadan and does not break his fast, owes anything, and I do not say that he has to make up for the day on which he had hijama, because hijama is only disapproved of for someone fasting if his fast is endangered. I do not think that someone who has hijama, and is then well enough to keep the fast until evening, owes anything, nor does he have to make up for that day.”” (Muwatta)