Change diagnostic as a result of researching <rdar://problem/6779809> missing interface name in "error: cannot declare variable inside a class, protocol or category ''.

Since ObjC 2.0 class "extensions" have a null name, the diagnostic above is actually "correct". Nevertheless, it is confusing. Decided to remove the name entirely (from my perspective, it didn't add any value). Also simplified the text of the diagnostic a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68967 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 49433b5..cf782ca 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1358,8 +1358,7 @@
         if (VarDecl *VDecl = dyn_cast<VarDecl>(*I)) {
           if (VDecl->getStorageClass() != VarDecl::Extern &&
               VDecl->getStorageClass() != VarDecl::PrivateExtern)
-            Diag(VDecl->getLocation(), diag::err_objc_var_decl_inclass) 
-              << cast<NamedDecl>(ClassDecl)->getDeclName();
+            Diag(VDecl->getLocation(), diag::err_objc_var_decl_inclass);
         }
     }
   }