Fix <rdar://problem/5965704> clang: bad receiver type 'id const'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51809 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index c55c058..dd90b9c 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -199,11 +199,12 @@
   
   Expr **ArgExprs = reinterpret_cast<Expr **>(Args);
   Expr *RExpr = static_cast<Expr *>(receiver);
-  QualType receiverType = RExpr->getType().getCanonicalType();
+  QualType receiverType;
   QualType returnType;
   ObjCMethodDecl *Method = 0;
+
+  receiverType = RExpr->getType().getCanonicalType().getUnqualifiedType();
   
-  // FIXME: This code is not stripping off type qualifiers! Should it?
   if (receiverType == Context.getObjCIdType().getCanonicalType() ||
       receiverType == Context.getObjCClassType().getCanonicalType()) {
     Method = InstanceMethodPool[Sel].Method;