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
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 3c544ed..6702eb9 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -623,8 +623,10 @@
   }  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