diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-08 01:10:55 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-08 01:10:55 +0000 |
commit | 305c658ebce84bb9833fc0e7675554656453b8e8 (patch) | |
tree | 5bbb2a39d1b87600b2a0c2bdfe956d6f297eae53 /lib/Sema/SemaDeclObjC.cpp | |
parent | c6ed3840d685bd40bd921dd1f76cfb5a9b4fc599 (diff) |
Objc's compatibility-alias semantics and code
gen issue fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61901 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index c32a806b7d..68e7744582 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -159,6 +159,15 @@ Sema::DeclTy *Sema::ActOnCompatiblityAlias(SourceLocation AtLoc, } // Check for class declaration Decl *CDeclU = LookupDecl(ClassName, Decl::IDNS_Ordinary, TUScope); + if (const TypedefDecl *TDecl = dyn_cast_or_null<TypedefDecl>(CDeclU)) { + QualType T = TDecl->getUnderlyingType(); + if (T->isObjCInterfaceType()) { + if (NamedDecl *IDecl = T->getAsObjCInterfaceType()->getDecl()) { + ClassName = IDecl->getIdentifier(); + CDeclU = LookupDecl(ClassName, Decl::IDNS_Ordinary, TUScope); + } + } + } ObjCInterfaceDecl *CDecl = dyn_cast_or_null<ObjCInterfaceDecl>(CDeclU); if (CDecl == 0) { Diag(ClassLocation, diag::warn_undef_interface) << ClassName; |