fix Issue 9977 - Function local templates should be allowed
Merge pull request #1919 from 9rnsr/fix9977

Issue 9977 - Function local templates should be allowed
Merge remote-tracking branch 'upstream/master' into patch-1