Fix linkage computation for local types in template functions.

Template functions (and member functions of class templates) present the same
problem as inline functions. They need to be uniqued, so we need to assign
VisibleNoLinkage linkage to types defined in them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183222 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a typo (chek => check)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183223 91177308-0d34-0410-b5e6-96231b3b80d8