aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-11-17 16:28:52 +0000
committerSteve Naroff <snaroff@apple.com>2008-11-17 16:28:52 +0000
commitd7612e183bb09d04677d0ddde89ee29130ffb715 (patch)
tree3bc5e4e86bc5fb5f0fa9a2f1d1b10c611d454fe7 /lib/Sema/Sema.cpp
parent43c7bad105f742988e7ca40564285c83bea854a5 (diff)
Fix <rdar://problem/6320086> parser rejects block capturing ivar.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index b78336b6cd..6495949526 100644
--- a/lib/Sema/Sema.cpp
+++ b/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);
}