diff options
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index b78336b6cd2..64959495269 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -241,5 +241,8 @@ const LangOptions &Sema::getLangOptions() const { } ObjCMethodDecl *Sema::getCurMethodDecl() { - return dyn_cast<ObjCMethodDecl>(CurContext); + DeclContext *DC = CurContext; + while (isa<BlockDecl>(DC)) + DC = DC->getParent(); + return dyn_cast<ObjCMethodDecl>(DC); } |