[OpenMP] Handle non-function context before checking for diagnostic
authorPremAnand Rao <premanand.m.rao@intel.com>
Fri, 5 Mar 2021 20:05:41 +0000 (12:05 -0800)
committerErich Keane <erich.keane@intel.com>
Fri, 5 Mar 2021 20:37:49 +0000 (12:37 -0800)
commitc2de5aff1a08ce70507f2c0a53eeffa5135c5273
tree74ba0be1ce57cbf523a18d9eaeaf7bb10b4da82e
parentfc28f600e558c1344618bda149a068d6162b6f0b
[OpenMP] Handle non-function context before checking for diagnostic
emission

Ensure that we are in a function declaration context before checking
the diagnostic emission status, to avoid dereferencing a NULL function
declaration.

Differential Revision: https://reviews.llvm.org/D97573
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/simd_null_pointer_access.cpp [new file with mode: 0644]