The Supreme Court has cautioned that protective sweeps must be "narrowly confined to a cursory visual inspection of those places in which a person might be hiding." Maryland v. Buie, 494 U.S. 325, 327 (1990).
Consequently---unless the police are looking for a very tiny person or at a very large toilet tank---leaning over and looking into an open toilet tank exceeds the scope of a protective sweep. So said the district court in United States v. Brown, 2018 WL 5603541 (S.D. Fla. Oct. 30, 2018):
The evidence indicates that when Detective Perdomo entered the bathroom he went to the bathtub and pulled back the curtain. Upon seeing the lid to the toilet tank in the bathtub, Detective Perdomo looked into the open toilet tank and saw a gun at the bottom of the toilet tank. Detective Perdomo could not have seen the gun at the bottom of the toilet tank without leaning over and looking into the tank. This action, however, exceeded the scope of a protective sweep. Clearly, a person could not have been hiding in the toilet tank. Thus, after checking behind the shower curtain to ensure that no one was hiding in the bathroom, the protective sweep in the bathroom should have been done. Consequently, Detective Perdomo’s look into the toilet tank was an improper search."
(Unfortunately for the defendant in this case, a subsequent search warrant for the house constituted an independent source for discovery of the gun. Motion to suppress denied.)