fix resolving forward reference for function template

with analyzing parameters in forward analysis.  some bugs
may remain yet.
fix a log file name