From a37b065e8fa57ae40d14dfdb5afed4628129b1ea Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Fri, 28 Aug 2015 22:56:21 +0000 Subject: Follow-up to r246338: use getParentFunctionOrMethod llvm-svn: 246348 --- clang/lib/Sema/SemaDecl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(VD->getDeclContext()); + auto *F = dyn_cast_or_null(VD->getParentFunctionOrMethod()); if (F && getDLLAttr(F)) { assert(VD->isStaticLocal()); // But if this is a static local in a dlimport/dllexport function, the -- cgit v1.2.3