Make sure Sema::ActOnClassMessage() correctly diagnoses "super".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48924 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 4cf435c..1a274e1 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -146,7 +146,10 @@
   ObjCInterfaceDecl* ClassDecl = 0;
   if (!strcmp(receiverName->getName(), "super") && CurMethodDecl) {
     ClassDecl = CurMethodDecl->getClassInterface()->getSuperClass();
-    if (ClassDecl && CurMethodDecl->isInstance()) {
+    if (!ClassDecl)
+      return Diag(lbrac, diag::error_no_super_class,
+                  CurMethodDecl->getClassInterface()->getName());
+    if (CurMethodDecl->isInstance()) {
       // Synthesize a cast to the super class. This hack allows us to loosely
       // represent super without creating a special expression node.
       IdentifierInfo &II = Context.Idents.get("self");