[OPENMP] Fix handling of OpenMP code during template instantiation.

If some function template is instantiated during handling of OpenMP
code, currently it may cause crash of compiler because of trying of
capturing variables in non-capturing function scopes. Patch fixes this
bug.

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