From here (thanks @Menachem):
The later-day poskim dispute whether our bathrooms have the halachic
status of the beis hakisei of the days of Chazal. Some poskim are
lenient since our bathrooms are much cleaner than old-time outhouses
(Shu’t Zakan Aharon 1:1; Shu’t Minchas Yitzchok 1:60). Others contend
that our bathrooms should still be treated as a beis hakisei (see
Shu’t Yechaveh Daas 3:1). Both the Chazon Ish (Orach Chayim 17:4) and
Rav Moshe Feinstein (Shu’t Igros Moshe, Even HaEzer 1:114) rule that
we should treat our bathrooms as a safek (questionable) beis hakisei.
The universal practice is to not recite brachos in the bathroom, but
some people are lenient to wash their hands there. Rav Moshe rules
that one may not wash for bread in our bathrooms, but one may wash his
hands there before davening, although one should dry one’s hands
outside the bathroom.
According to what I have explained above, if we assume that our
bathrooms have the halachic status of a beis hakisei; one should not
recite a bracha, sing zemiros, or say divrei Torah facing the bathroom
when its door is ajar. However, if we assume that it is only
questionable, then one may have grounds to be lenient.