From: Hans Wennborg Date: Fri, 28 Aug 2015 22:56:21 +0000 (+0000) Subject: Follow-up to r246338: use getParentFunctionOrMethod X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7033dfaec4b3c2d15dfcb845ae3104319da5ef0a;p=clang Follow-up to r246338: use getParentFunctionOrMethod git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246348 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 1fe6a5c18f..c74bb8351e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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