Whoever constructs or helps to construct a Vishnu temple will protect eight generations of fathers, grandfathers, and forefathers from falling into hell.
This verse is found in the Vamana Purana 95.38
पञ्चनवतितमोऽध्यायः - वामनपुराणम्
पितामहस्य पुरतः कुलान्यष्टौ तु यानि च।
तारयेदात्मना सार्धं विष्णोर्मन्दिरकारकः।। ९५.3८
- And the Eight Generations before the grandfather and his own self he reclaims who gets a temple of Vishnu constructed.
English Translation by Digital India Government Library
One may also read the Hindi translation by Gita Press Gorakhpur from here.