Author: hans Date: Fri Aug 28 17:56:21 2015 New Revision: 246348 URL: http://llvm.org/viewvc/llvm-project?rev=246348&view=rev Log: Follow-up to r246338: use getParentFunctionOrMethod
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp Modified: cfe/trunk/lib/Sema/SemaDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=246348&r1=246347&r2=246348&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDecl.cpp (original) +++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Aug 28 17:56:21 2015 @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits