summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-05-07 21:49:26 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-05-07 21:49:26 +0000
commit0d451813f90b55b87a5736b80963ffc9685b7514 (patch)
tree7a018c698a25d79210eeba4efc3829db61fc4f8a /clang/lib/Sema/SemaDeclObjC.cpp
parent5352454e6b6d10e6a37d47f424b2a00d5aa0c0ea (diff)
downloadbcm5719-llvm-0d451813f90b55b87a5736b80963ffc9685b7514.tar.gz
bcm5719-llvm-0d451813f90b55b87a5736b80963ffc9685b7514.zip
a forward class declaration matching a typedef name of a class
refers to the underlying class. This is radar 6859726. Steve, please read the radar for my rational. llvm-svn: 71181
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 0e655a493da..27f127716e5 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -1075,6 +1075,13 @@ Sema::ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
Diag(AtClassLoc, diag::err_redefinition_different_kind) << IdentList[i];
Diag(PrevDecl->getLocation(), diag::note_previous_definition);
}
+ else if (TDD) {
+ // a forward class declaration matching a typedef name of a class
+ // refers to the underlying class.
+ if (ObjCInterfaceType * OI =
+ dyn_cast<ObjCInterfaceType>(TDD->getUnderlyingType()))
+ PrevDecl = OI->getDecl();
+ }
}
ObjCInterfaceDecl *IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
if (!IDecl) { // Not already seen? Make a forward decl.
OpenPOWER on IntegriCloud