Roman Catechism 24.49

Chapter 24 — Part III: The Decalogue — The First Commandment

Section 49. The faithful are also to be taught that the punishments here threatened await the third and fourth generation of the impious and wicked; not that the children are always chastised for the sins of their ancestors, but that while these and their children may go unpunished, their posterity shall not all escape the wrath and vengeance of the Almighty. This happened in the case of King Josias. God had spared him for his singular piety, and allowed him to be gathered to the tomb of his fathers in peace, that his eyes might not behold the evils of the times that were to befall Juda and Jerusalem, on account of the wickedness of his grandfather Manasses; yet, after his death the divine vengeance so overtook his posterity that even the children of Josias were not spared.