The Catholic Church has issued a warning to its clergy in Washington state: Any priest who complies with a new law requiring the reporting of child abuse confessions to authorities will be excommunicated.
https://www.newsweek.com/catholic-church-excommunicate-priests-following-new-us-state-law-2069039
Here’s a link to the law as passed.
It doesn’t seem to explicitly allow what you are suggesting but I supposed the “or cause a report to be made” clause could be interpreted that way.