Fix <rdar://problem/6770276> Support Class<Proto> syntax.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76741 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 068b386..2d14410 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -512,8 +512,7 @@
   }
 
   // Handle messages to id.  
-  if (ReceiverCType == Context.getCanonicalType(Context.getObjCIdType()) ||
-      ReceiverCType->isBlockPointerType() ||
+  if (ReceiverCType->isObjCIdType() || ReceiverCType->isBlockPointerType() ||
       Context.isObjCNSObjectType(RExpr->getType())) {
     ObjCMethodDecl *Method = LookupInstanceMethodInGlobalPool(
                                Sel, SourceRange(lbrac,rbrac));
@@ -528,7 +527,8 @@
   }
   
   // Handle messages to Class.
-  if (ReceiverCType == Context.getCanonicalType(Context.getObjCClassType())) {
+  if (ReceiverCType->isObjCClassType() || 
+      ReceiverCType->isObjCQualifiedClassType()) {
     ObjCMethodDecl *Method = 0;
     
     if (ObjCMethodDecl *CurMeth = getCurMethodDecl()) {
@@ -538,6 +538,9 @@
         
         if (!Method)
           Method = LookupPrivateClassMethod(Sel, ClassDecl);
+          
+        // FIXME: if we still haven't found a method, we need to look in 
+        // protocols (if we have qualifiers).
       }
       if (Method && DiagnoseUseOfDecl(Method, receiverLoc))
         return true;