fix Issue 9880 - Redundant template instance displaying in error message
Merge pull request #1845 from 9rnsr/fix9880

Issue 9880 - Redundant template instance displaying in error message
Fixes Issue 9680 - Print main function and location in verbose mode.

Add test-case script by Kenji Hara.