In the US the HIPAA rules often provide you with confidentiality but there are several circumstances that allow your doctor to provide info without your consent and being a pilot qualifies. It allows them to, but only requires them to in situations where a crime might be involved, i.e. physical abuse.
The concern would probably not be that your doctor will tell the FAA (although they probably could if they were truly concerned), it would be that you would be required to tell your FAA examiner of any diagnosis. I believe it's a felony not to.
If it's sleep apnea he's concerned about (you said sleep problem, non-narcolepsy - I'm not a doctor so I'm just offering what i know about a very common sleep problem) then there are ways to get a special issuance medical certificate.
I'm not a pilot but a driver and I have to have a DOT medical card. The way sleep apnea is usually treated is by CPAP. For the DOT physical, If you are on CPAP you have to bring the machine to your physical so the examiner can check the data and verify that you have been using it (I think 75% of the time but don't quote me on that). I checked and the FAA has similar rules.
I agree with Pondlife that one's health should trump licensing concerns, and nobody should be flying if they are at risk of dozing off. But I definitely understand your friend's situation. I suspected I had apnea but I refused to go to a sleep study because I did not want the diagnosis. What if I couldn't deal with CPAP? My dad was on CPAP for 30 years but he rarely used it because it was too uncomfortable. Then I'd be forced to use it to keep my job.
Fortunately my situation resolved itself (I don't have apnea) but I understand why he's reticent to mention it to his doctor.