fix Issue 6539 - Incomprehensible error message with failed template instantiation
fix Issue 9199 - Module level qualified functions should be rejected
Apply review points by Andrej Mitrovic
Merge pull request #1661 from 9rnsr/fix6539

Issue 6539 - Incomprehensible error message with failed template instantiation
Merge pull request #1400 from 9rnsr/fix9199

Issue 9199 - Module level qualified functions should be rejected