Fix checking unused local functions and default arguments
Add tests for warning
Merge pull request #1107 from mururu/check-unused-func

Fix missing unused private function and add test for warnings