summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-12 09:02:39 +0000
committerChris Lattner <sabre@nondot.org>2009-04-12 09:02:39 +0000
commit0d5640c7be6398904152c70f9317933e95161ad7 (patch)
tree7e6b4fbf7ce92242df9256f46bb4769344f74caf /clang/lib
parentbaa405fc4c58709a7cb2048f1cf52c5b3e83652f (diff)
downloadbcm5719-llvm-0d5640c7be6398904152c70f9317933e95161ad7.tar.gz
bcm5719-llvm-0d5640c7be6398904152c70f9317933e95161ad7.zip
Fix rdar://6770142 - Class and qualified id's are compatible, just like
Class and unqualified id's are. llvm-svn: 68899
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp3
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp8
2 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index e380f78ad05..0dc3b87d524 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -3060,8 +3060,7 @@ Sema::CheckSingleAssignmentConstraints(QualType lhsType, Expr *&rExpr) {
if (PerformImplicitConversion(rExpr, lhsType.getUnqualifiedType(),
"assigning"))
return Incompatible;
- else
- return Compatible;
+ return Compatible;
}
// FIXME: Currently, we fall through and treat C++ classes like C
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index 8d8fae035a1..0c1f1448028 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/lib/Sema/SemaExprObjC.cpp
@@ -681,11 +681,15 @@ bool Sema::ObjCQualifiedIdTypesAreCompatible(QualType lhs, QualType rhs,
// Allow id<P..> and an 'id' or void* type in all cases.
if (const PointerType *PT = lhs->getAsPointerType()) {
QualType PointeeTy = PT->getPointeeType();
- if (Context.isObjCIdStructType(PointeeTy) || PointeeTy->isVoidType())
+ if (PointeeTy->isVoidType() ||
+ Context.isObjCIdStructType(PointeeTy) ||
+ Context.isObjCClassStructType(PointeeTy))
return true;
} else if (const PointerType *PT = rhs->getAsPointerType()) {
QualType PointeeTy = PT->getPointeeType();
- if (Context.isObjCIdStructType(PointeeTy) || PointeeTy->isVoidType())
+ if (PointeeTy->isVoidType() ||
+ Context.isObjCIdStructType(PointeeTy) ||
+ Context.isObjCClassStructType(PointeeTy))
return true;
}
OpenPOWER on IntegriCloud