Really, the idea that a priest or other clergy member cannot tell anything that is said to them during a confession could come up in any legal case you can think of. All that has to happen is that someone must commit a criminal act and then go confess it to a member of clergy.
So, for a hypothetical, let us say that there is a teacher. This teacher "grooms" a student and then starts a sexual relationship with her. Let us say that the teacher then goes and confesses the relationship to a priest. Let us say that the school suspects the teacher and informs the police. The police charge the teacher and try to get the priest to testify because his testimony would be the only first-hand evidence available (the girl is refusing to testify).