aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index a1580f14dc..96839a5421 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -343,8 +343,10 @@ DeclContext *Sema::getContainingDC(DeclContext *DC) {
return DC;
}
+ // ObjCMethodDecls are parsed (for some reason) outside the context
+ // of the class.
if (isa<ObjCMethodDecl>(DC))
- return Context.getTranslationUnitDecl();
+ return DC->getLexicalParent()->getLexicalParent();
return DC->getLexicalParent();
}