From 4f8cb1e83a0f17d17aac25bb041d195d158bd08b Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 12 Jan 2012 00:18:35 +0000 Subject: objective-c: fixes a regression in looking up names in class extensions and categories by recent refactoring of objc class ASTs. // rdar://1066654 llvm-svn: 147982 --- clang/lib/Sema/SemaDecl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index f30f1fa5be6..dc8d6ec8cf7 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1255,8 +1255,11 @@ ObjCInterfaceDecl *Sema::getObjCInterfaceDecl(IdentifierInfo *&Id, Id = IDecl->getIdentifier(); } } - - return dyn_cast_or_null(IDecl); + ObjCInterfaceDecl *Def = dyn_cast_or_null(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 -- cgit v1.2.3