aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-01-12 00:18:35 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-01-12 00:18:35 +0000
commit3306f961fa940754dfa0e4e34c57e0c57bea3890 (patch)
tree54075f974d94b859b1c0ebb30f1b87a1da5dff2f /lib/Sema/SemaDecl.cpp
parent5b7254c2c31d385eba95fc4d31e87587ec31fd63 (diff)
objective-c: fixes a regression in looking up names
in class extensions and categories by recent refactoring of objc class ASTs. // rdar://1066654 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147982 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index f30f1fa5be..dc8d6ec8cf 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1255,8 +1255,11 @@ ObjCInterfaceDecl *Sema::getObjCInterfaceDecl(IdentifierInfo *&Id,
Id = IDecl->getIdentifier();
}
}
-
- return dyn_cast_or_null<ObjCInterfaceDecl>(IDecl);
+ ObjCInterfaceDecl *Def = dyn_cast_or_null<ObjCInterfaceDecl>(IDecl);
+ // This routine must always return a class definition, if any.
+ if (Def && Def->getDefinition())
+ Def = Def->getDefinition();
+ return Def;
}
/// getNonFieldDeclScope - Retrieves the innermost scope, starting