Lots of people take diphenhydramine products as sleeping pills and they are advertised as such OTC in the US. Long term Diphenhydramine use is associated with many negative health outcomes and despite the warning labels many people become dependent on them.
Yes - I saw a very interesting video the other day that educated me a lot on Benadryl - apparently it has a lot of side effects, can cause dementia, and is probably best avoided.
The parent post was talking about doctor prescribed medications.
The reason diphenhydramine Is associated with a slight increase in dementia risk is the anticholinergic properties. This risk increase is from correlational studies on other medications with anticholinergic medicines being taken for many years by elderly people, so the risk of taking Benadryl occasionally is low to none.
The prescription alternatives like doxepin have the same antihistamine properties without the anticholinergic properties when used at the prescribed dose.
This is an example where people can get themselves into the wrong outcome by assuming anything their doctor prescribes is a last resort quick fix, but anything they can source by themself is safer and superior.