break;
}
case Decl::ObjCCompatibleAlias:
- ErrorUnsupported(D, "Objective-C compatible alias");
+ // compatibility-alias is a directive and has no code gen.
break;
case Decl::LinkageSpec: {
}
// 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;
--- /dev/null
+// RUN: clang -emit-llvm -o %t %s
+
+@interface Int1 @end
+
+typedef Int1 Int1Typedef;
+@compatibility_alias Int1Alias Int1Typedef;
+
+@implementation Int1Alias @end