[llvm-branch-commits] [cfe-tag] r99449 - in /cfe/tags/Apple/clang/clang/tools/clang: lib/Sema/SemaExpr.cpp test/SemaObjC/comptypes-7.m

Ted Kremenek kremenek at apple.com
Wed Mar 24 16:20:18 PDT 2010


Author: kremenek
Date: Wed Mar 24 18:20:18 2010
New Revision: 99449

URL: http://llvm.org/viewvc/llvm-project?rev=99449&view=rev
Log:
Merge in r99425.

Modified:
    cfe/tags/Apple/clang/clang/tools/clang/lib/Sema/SemaExpr.cpp
    cfe/tags/Apple/clang/clang/tools/clang/test/SemaObjC/comptypes-7.m

Modified: cfe/tags/Apple/clang/clang/tools/clang/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/tags/Apple/clang/clang/tools/clang/lib/Sema/SemaExpr.cpp?rev=99449&r1=99448&r2=99449&view=diff
==============================================================================
--- cfe/tags/Apple/clang/clang/tools/clang/lib/Sema/SemaExpr.cpp (original)
+++ cfe/tags/Apple/clang/clang/tools/clang/lib/Sema/SemaExpr.cpp Wed Mar 24 18:20:18 2010
@@ -4594,13 +4594,15 @@
 Sema::CheckObjCPointerTypesForAssignment(QualType lhsType, QualType rhsType) {
   if (lhsType->isObjCBuiltinType()) {
     // Class is not compatible with ObjC object pointers.
-    if (lhsType->isObjCClassType() && !rhsType->isObjCBuiltinType())
+    if (lhsType->isObjCClassType() && !rhsType->isObjCBuiltinType() &&
+        !rhsType->isObjCQualifiedClassType())
       return IncompatiblePointer;
     return Compatible;
   }
   if (rhsType->isObjCBuiltinType()) {
     // Class is not compatible with ObjC object pointers.
-    if (rhsType->isObjCClassType() && !lhsType->isObjCBuiltinType())
+    if (rhsType->isObjCClassType() && !lhsType->isObjCBuiltinType() &&
+        !lhsType->isObjCQualifiedClassType())
       return IncompatiblePointer;
     return Compatible;
   }

Modified: cfe/tags/Apple/clang/clang/tools/clang/test/SemaObjC/comptypes-7.m
URL: http://llvm.org/viewvc/llvm-project/cfe/tags/Apple/clang/clang/tools/clang/test/SemaObjC/comptypes-7.m?rev=99449&r1=99448&r2=99449&view=diff
==============================================================================
--- cfe/tags/Apple/clang/clang/tools/clang/test/SemaObjC/comptypes-7.m (original)
+++ cfe/tags/Apple/clang/clang/tools/clang/test/SemaObjC/comptypes-7.m Wed Mar 24 18:20:18 2010
@@ -66,5 +66,10 @@
   if (obj_C == j) foo() ; // expected-warning {{comparison of distinct pointer types ('Class' and 'int *')}}
   if (j == obj_C) foo() ; // expected-warning {{comparison of distinct pointer types ('int *' and 'Class')}}
 
+  Class bar1 = Nil;
+  Class <MyProtocol> bar = Nil;
+  bar = bar1;
+  bar1 = bar;
+
   return 0;
 }





More information about the llvm-branch-commits mailing list