diff options
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 1fe6a5c18f1..c74bb8351e8 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -9967,7 +9967,7 @@ Sema::FinalizeDeclaration(Decl *ThisDecl) { // dllimport/dllexport variables cannot be thread local, their TLS index // isn't exported with the variable. if (DLLAttr && VD->getTLSKind()) { - FunctionDecl *F = dyn_cast<FunctionDecl>(VD->getDeclContext()); + auto *F = dyn_cast_or_null<FunctionDecl>(VD->getParentFunctionOrMethod()); if (F && getDLLAttr(F)) { assert(VD->isStaticLocal()); // But if this is a static local in a dlimport/dllexport function, the |