This does not apply to Catholic priests. Under no circumstances are they permitted to share anything heard in the confessional with any third party, even if to protect others or themselves.
It is likely that a child molester who confesses a crime in the confessional will not be given absolution unless said molester turns himself in to the police. Regardless, the priest is still not permitted to share the information with the authorities.
The seal of confession is inviolate.
If there is a confession about a future intended crime, I don't think that is protected by any legal privilege (at least not for lawyers), nor should it. I suspect a failure to report it, is itself a crime. It should be in any event. JMO.
It's about a priest who hears a murder's confession, and then the murderer abuses the seal of the confessional by framing the priest.
One of the greatest crime dramas of all time, IMHO.