Fixed #4684 (cppcheck crash in template function call.)