aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-04-23 21:49:04 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-04-23 21:49:04 +0000
commit77a6be4826d1752ba834fddbbf3114f70cda2be5 (patch)
tree0c0b42e22d0682b5f71ffbb100fda9a704dbeecf /lib/Sema/SemaDeclObjC.cpp
parentf9df1362f0f2768ddab01fbf8d60c4808e641162 (diff)
Diagnose if an implementation implements a forward class
declaration (and avoid issuing bogus error later on). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 3c544ed377..6702eb9a7a 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -623,8 +623,10 @@ Sema::DeclPtrTy Sema::ActOnStartClassImplementation(
} else {
// Is there an interface declaration of this class; if not, warn!
IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
- if (!IDecl)
+ if (!IDecl || IDecl->isForwardDecl()) {
Diag(ClassLoc, diag::warn_undef_interface) << ClassName;
+ IDecl = 0;
+ }
}
// Check that super class name is valid class name