diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-05-07 21:49:26 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-05-07 21:49:26 +0000 |
commit | cae27c51f0da674cdd3b53b8b2f7ba08c44c54b0 (patch) | |
tree | a267bd35d3d2854d642170400f2623dbeeb7496f /lib/Sema/SemaDeclObjC.cpp | |
parent | 908116859ed8c166c1c0712992e504edd0c5a6e1 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 0e655a493d..27f127716e 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/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. |